├── .gitignore ├── Dockerfile ├── proptest-regressions └── arbitrary.txt ├── src ├── stats.rs ├── verifier.rs ├── main.rs ├── fuzzer.rs └── arbitrary.rs ├── .github └── workflows │ ├── publish-container-images.yml │ ├── ci.yml │ └── release.yml ├── Cargo.toml ├── CHANGELOG.md ├── README.md ├── Cargo.lock └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | target 2 | results 3 | schemas 4 | openapi-fuzzer* 5 | 6 | .vscode 7 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM messense/rust-musl-cross:x86_64-musl as builder 2 | 3 | WORKDIR /openapi-fuzzer 4 | COPY . /openapi-fuzzer 5 | RUN cargo build --release --target x86_64-unknown-linux-musl 6 | 7 | FROM scratch 8 | COPY --from=builder openapi-fuzzer/target/x86_64-unknown-linux-musl/release/openapi-fuzzer /openapi-fuzzer 9 | ENTRYPOINT ["/openapi-fuzzer"] 10 | -------------------------------------------------------------------------------- /proptest-regressions/arbitrary.txt: -------------------------------------------------------------------------------- 1 | # Seeds for failure cases proptest has generated in the past. It is 2 | # automatically read and these particular cases re-run before any 3 | # novel cases are generated. 4 | # 5 | # It is recommended to check this file in to source control so that 6 | # everyone who runs the test benefits from these saved cases. 7 | cc 326cae2d03e90083d2e7ddb4d1592970755d6a95b0d19127d3834b323aadda69 # shrinks to headers = Headers([("foo", "ጘ")]) 8 | -------------------------------------------------------------------------------- /src/stats.rs: -------------------------------------------------------------------------------- 1 | #[derive(Debug)] 2 | pub struct Stats { 3 | pub min: u128, 4 | pub max: u128, 5 | pub mean: f64, 6 | pub std_dev: f64, 7 | } 8 | 9 | impl Stats { 10 | pub fn compute(data: &[u128]) -> Option { 11 | if data.is_empty() { 12 | return None; 13 | } 14 | let min = *data.iter().min().expect("data length is nonzero"); 15 | let max = *data.iter().max().expect("data length is nonzero"); 16 | let sum: u128 = data.iter().sum(); 17 | let mean = sum as f64 / data.len() as f64; 18 | 19 | let variance = data 20 | .iter() 21 | .map(|value| (mean - (*value as f64)).powf(2.)) 22 | .sum::() 23 | / (data.len() as f64); 24 | 25 | Some(Stats { 26 | min, 27 | max, 28 | mean, 29 | std_dev: variance.sqrt(), 30 | }) 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /src/verifier.rs: -------------------------------------------------------------------------------- 1 | use std::sync::Arc; 2 | 3 | use rustls::client::ServerCertVerifier; 4 | 5 | // See https://quinn-rs.github.io/quinn/quinn/certificate.html#insecure-connection 6 | struct SkipTlsVerification {} 7 | 8 | impl ServerCertVerifier for SkipTlsVerification { 9 | fn verify_server_cert( 10 | &self, 11 | _end_entity: &rustls::Certificate, 12 | _intermediates: &[rustls::Certificate], 13 | _server_name: &rustls::ServerName, 14 | _scts: &mut dyn Iterator, 15 | _ocsp_response: &[u8], 16 | _now: std::time::SystemTime, 17 | ) -> Result { 18 | // always accept the certificate 19 | Ok(rustls::client::ServerCertVerified::assertion()) 20 | } 21 | } 22 | 23 | pub fn skip_tls_verification_config() -> rustls::ClientConfig { 24 | rustls::ClientConfig::builder() 25 | .with_safe_defaults() 26 | .with_custom_certificate_verifier(Arc::new(SkipTlsVerification {})) 27 | .with_no_client_auth() 28 | } 29 | -------------------------------------------------------------------------------- /.github/workflows/publish-container-images.yml: -------------------------------------------------------------------------------- 1 | name: publish-container-images 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | tags: 7 | - "v*" 8 | 9 | env: 10 | REGISTRY: ghcr.io 11 | 12 | jobs: 13 | build-and-push-image: 14 | runs-on: ubuntu-latest 15 | permissions: 16 | contents: read 17 | packages: write 18 | 19 | steps: 20 | - name: Checkout repository 21 | uses: actions/checkout@v3 22 | 23 | - name: Log in to the Container registry 24 | uses: docker/login-action@v2 25 | with: 26 | registry: ${{ env.REGISTRY }} 27 | username: ${{ github.actor }} 28 | password: ${{ secrets.GITHUB_TOKEN }} 29 | 30 | - name: Extract metadata (tags, labels) for Docker 31 | id: meta 32 | uses: docker/metadata-action@v4 33 | with: 34 | images: ${{ env.REGISTRY }}/${{ github.repository }} 35 | tags: | 36 | type=ref,event=tag 37 | type=ref,event=pr 38 | type=sha,format=short,prefix= 39 | type=raw,value=latest 40 | 41 | - name: Build and push Docker image 42 | if: "startsWith(github.ref, 'refs/tags/') || startsWith(github.ref, 'refs/heads/master')" 43 | uses: docker/build-push-action@v4 44 | with: 45 | context: . 46 | push: true 47 | tags: ${{ steps.meta.outputs.tags }} 48 | labels: ${{ steps.meta.outputs.labels }} 49 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "openapi-fuzzer" 3 | version = "0.2.0" 4 | authors = ["Matus Ferech "] 5 | description = "Black-box fuzzer that fuzzes APIs based on OpenAPI specification " 6 | edition = "2018" 7 | license = "AGPL-3.0-or-later" 8 | repository = "https://github.com/matusf/openapi-fuzzer" 9 | readme = "README.md" 10 | default-run = "openapi-fuzzer" 11 | 12 | [dependencies] 13 | argh = "0.1.4" 14 | url = { version = "2.2.0", features = ["serde"] } 15 | anyhow = "1.0.37" 16 | openapiv3 = "0.5.0" 17 | serde = "1.0" 18 | serde_yaml = "0.8" 19 | ureq = { version = "2.7.0", features = ["json", "native-certs"] } 20 | rustls = { version = "0.21", features = ["dangerous_configuration"] } 21 | openapi_utils = "0.2.2" 22 | arbitrary = "1" 23 | serde_json = "1.0" 24 | proptest = "1.1.0" 25 | indexmap = "1.9.1" 26 | 27 | [dev-dependencies] 28 | 29 | # The profile that 'cargo dist' will build with 30 | [profile.dist] 31 | inherits = "release" 32 | lto = "thin" 33 | 34 | # Config for 'cargo dist' 35 | [workspace.metadata.dist] 36 | # The preferred cargo-dist version to use in CI (Cargo.toml SemVer syntax) 37 | cargo-dist-version = "0.1.0" 38 | # CI backends to support (see 'cargo dist generate-ci') 39 | ci = ["github"] 40 | # The installers to generate for each app 41 | installers = [] 42 | # Target platforms to build apps for (Rust target-triple syntax) 43 | targets = [ 44 | "x86_64-unknown-linux-gnu", 45 | "x86_64-apple-darwin", 46 | "x86_64-pc-windows-msvc", 47 | "aarch64-apple-darwin", 48 | ] 49 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI 2 | 3 | on: 4 | push: 5 | branches: [master] 6 | tags: 7 | - "v*" 8 | pull_request: 9 | workflow_dispatch: 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - name: checkout 16 | uses: actions/checkout@v3 17 | 18 | - name: install Rust 19 | uses: dtolnay/rust-toolchain@master 20 | with: 21 | toolchain: stable 22 | components: clippy, rustfmt 23 | 24 | - name: lint 25 | run: cargo clippy 26 | 27 | - name: check format 28 | run: cargo fmt --check 29 | 30 | - name: test 31 | run: cargo test 32 | 33 | test-build-image: 34 | if: "!startsWith(github.ref, 'refs/tags/')" 35 | runs-on: ubuntu-latest 36 | 37 | steps: 38 | - name: Checkout repository 39 | uses: actions/checkout@v3 40 | 41 | - name: Build Docker image 42 | uses: docker/build-push-action@v4 43 | with: 44 | context: . 45 | push: false 46 | 47 | release: 48 | name: Publish on crates.io 49 | runs-on: ubuntu-latest 50 | if: "startsWith(github.ref, 'refs/tags/')" 51 | needs: [test] 52 | steps: 53 | - name: Checkout repository 54 | uses: actions/checkout@v3 55 | 56 | - name: Install Rust 57 | uses: dtolnay/rust-toolchain@master 58 | with: 59 | toolchain: stable 60 | 61 | - name: Publish on crates.io 62 | run: | 63 | cargo login ${{ secrets.CRATES_TOKEN }} 64 | cargo publish 65 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Changelog 2 | 3 | All notable changes to this project will be documented in this file. 4 | 5 | ## [0.2.0] - 2023-08-29 6 | 7 | ### Features 8 | 9 | - Make maximum test-case count confugurable 10 | - **Save only minimal failing test-case** 11 | - Print status code and message when resending result 12 | - Add option to specify the results directory 13 | - Add option to measure request & response time 14 | - Save status of the requests alongside the times 15 | - Make results and stats dir configurable 16 | - Exit with failure if some test case failed 17 | 18 | ### Bug Fixes 19 | 20 | - Generate only valid headers 21 | - Stop fuzzer if unable to send request 22 | 23 | ### Documentation 24 | 25 | - Include instructions for building containers 26 | - Added OpenAPI specification version to README.md 27 | - State that --spec flag takes a file as an argument 28 | 29 | ### Refactor 30 | 31 | - Rename payload to request 32 | - Implement json array and object generation 33 | - Implement arbitrary for JSON, headers, path and query parameters 34 | - Implement fuzzer payload generation using arbitrary types 35 | - Remove unused modules 36 | - Remove unneeded clones by using `mem::take` 37 | - Restructure cli and add resender subcommand 38 | - Implement payload generation for one_of schema kind 39 | - Implement payload generation for any_of schema kind 40 | - Use prop_map_into instead of prop_map + into in json generation 41 | - Implement payload generation for all_of schema kind 42 | 43 | ### Testing 44 | 45 | - Add test for generating only valid headers 46 | 47 | ### Building 48 | 49 | - Update proptest version 50 | 51 | ### CI 52 | 53 | - Update checkout action 54 | - Use dtolnay action for rust 55 | - Add test job 56 | - Add Dockerfile 57 | - Add jobs for building and publishing container images 58 | - Add job to publish openapi-fuzzer to crates.io 59 | - Add ci generated by cargo-dist 60 | 61 | ### Miscellaneous Tasks 62 | 63 | - Add changelog 64 | 65 | ## [0.1.3] - 2021-11-16 66 | 67 | ### Building 68 | 69 | - Update openapiv3 and openapi_utils dependencies 70 | 71 | ## [0.1.2] - 2021-11-16 72 | 73 | ### Features 74 | 75 | - Use native certificates 76 | - Send cookies as headers 77 | - Create payload for any schema kind 78 | - Create payload also for oneOf, anyOf and allOf schema kinds 79 | 80 | ### Changed 81 | 82 | - Pretty print response if possible 83 | 84 | ### Bug Fixes 85 | 86 | - Make header comparison case insensitive 87 | 88 | ### Documentation 89 | 90 | - Add findings section & update readme 91 | - Fix links to gitea issues in README 92 | 93 | ## [0.1.1] - 2021-04-07 94 | 95 | ### Miscellaneous Tasks 96 | 97 | - Add LICENSE 98 | - Add metadata and installation option from crates.io 99 | 100 | ## [0.1.0] - 2021-04-07 101 | 102 | ### Features 103 | 104 | - Resolve references ($ref) to objects thanks to openapi_utils 105 | - Fuzz cookies, headers, query & path parameters 106 | - Fuzz remaining HTTP methods 107 | - Prepare, send and check requests 108 | - Add option to ignore status codes 109 | - Save findings to files 110 | - add finding formated as curl command 111 | - Report all 500 status codes as findings if not ignored 112 | - Generate unicode instead of alphanumeric values 113 | - Add short option for ignored status codes 114 | - Add option to specify additional headers (-H) 115 | - Randomize the size of the payload for arbitrary 116 | - Trim / from the the start of the path 117 | - Implements simple statistics for the fuzzer 118 | - Add TUI 119 | - Make table rows scrollable 120 | - Map Home & End keys to move to the first & last row respectively 121 | - Color successful findings number in red 122 | - Add resender binary to make it easier to replicate the finding 123 | 124 | ### Bug Fixes 125 | 126 | - Uppercase methods and set any status (ok on non 200 responses) 127 | - Skip non-json bodies 128 | - Add trailing slash to url if not present 129 | 130 | ### Documentation 131 | 132 | - Add building instructions 133 | - Add demo and usage guide to README 134 | 135 | ### Building 136 | 137 | - Update ureq to allow responses without status text 138 | 139 | ### Refactor 140 | 141 | - Restructure & split project 142 | - Create payload module 143 | - Generate valid unicode characters right away 144 | - Move functions for generating json out of Payload impl 145 | - Process all incomming events when rendering 146 | - Process events before rendering 147 | - Restructure result file 148 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # Copyright 2022-2023, axodotdev 2 | # SPDX-License-Identifier: MIT or Apache-2.0 3 | # 4 | # CI that: 5 | # 6 | # * checks for a Git Tag that looks like a release 7 | # * creates a Github Release™ and fills in its text 8 | # * builds artifacts with cargo-dist (executable-zips, installers) 9 | # * uploads those artifacts to the Github Release™ 10 | # 11 | # Note that the Github Release™ will be created before the artifacts, 12 | # so there will be a few minutes where the release has no artifacts 13 | # and then they will slowly trickle in, possibly failing. To make 14 | # this more pleasant we mark the release as a "draft" until all 15 | # artifacts have been successfully uploaded. This allows you to 16 | # choose what to do with partial successes and avoids spamming 17 | # anyone with notifications before the release is actually ready. 18 | name: release 19 | 20 | permissions: 21 | contents: write 22 | 23 | # This task will run whenever you push a git tag that looks like a version 24 | # like "v1", "v1.2.0", "v0.1.0-prerelease01", "my-app-v1.0.0", etc. 25 | # The version will be roughly parsed as ({PACKAGE_NAME}-)?v{VERSION}, where 26 | # PACKAGE_NAME must be the name of a Cargo package in your workspace, and VERSION 27 | # must be a Cargo-style SemVer Version. 28 | # 29 | # If PACKAGE_NAME is specified, then we will create a Github Release™ for that 30 | # package (erroring out if it doesn't have the given version or isn't cargo-dist-able). 31 | # 32 | # If PACKAGE_NAME isn't specified, then we will create a Github Release™ for all 33 | # (cargo-dist-able) packages in the workspace with that version (this is mode is 34 | # intended for workspaces with only one dist-able package, or with all dist-able 35 | # packages versioned/released in lockstep). 36 | # 37 | # If you push multiple tags at once, separate instances of this workflow will 38 | # spin up, creating an independent Github Release™ for each one. 39 | # 40 | # If there's a prerelease-style suffix to the version then the Github Release™ 41 | # will be marked as a prerelease. 42 | on: 43 | push: 44 | tags: 45 | - "*-?v[0-9]+*" 46 | 47 | jobs: 48 | # Create the Github Release™ so the packages have something to be uploaded to 49 | create-release: 50 | runs-on: ubuntu-latest 51 | outputs: 52 | has-releases: ${{ steps.create-release.outputs.has-releases }} 53 | env: 54 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 55 | steps: 56 | - uses: actions/checkout@v3 57 | with: 58 | submodules: recursive 59 | - name: Install cargo-dist 60 | run: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.1.0/cargo-dist-installer.sh | sh" 61 | - id: create-release 62 | run: | 63 | cargo dist plan --tag=${{ github.ref_name }} --output-format=json > dist-manifest.json 64 | echo "dist plan ran successfully" 65 | cat dist-manifest.json 66 | 67 | # Create the Github Release™ based on what cargo-dist thinks it should be 68 | ANNOUNCEMENT_TITLE=$(jq --raw-output ".announcement_title" dist-manifest.json) 69 | IS_PRERELEASE=$(jq --raw-output ".announcement_is_prerelease" dist-manifest.json) 70 | jq --raw-output ".announcement_github_body" dist-manifest.json > new_dist_announcement.md 71 | gh release create ${{ github.ref_name }} --draft --prerelease="$IS_PRERELEASE" --title="$ANNOUNCEMENT_TITLE" --notes-file=new_dist_announcement.md 72 | echo "created announcement!" 73 | 74 | # Upload the manifest to the Github Release™ 75 | gh release upload ${{ github.ref_name }} dist-manifest.json 76 | echo "uploaded manifest!" 77 | 78 | # Disable all the upload-artifacts tasks if we have no actual releases 79 | HAS_RELEASES=$(jq --raw-output ".releases != null" dist-manifest.json) 80 | echo "has-releases=$HAS_RELEASES" >> "$GITHUB_OUTPUT" 81 | 82 | # Build and packages all the things 83 | upload-artifacts: 84 | # Let the initial task tell us to not run (currently very blunt) 85 | needs: create-release 86 | if: ${{ needs.create-release.outputs.has-releases == 'true' }} 87 | strategy: 88 | fail-fast: false 89 | matrix: 90 | # For these target platforms 91 | include: 92 | - os: "macos-11" 93 | dist-args: "--artifacts=local --target=aarch64-apple-darwin" 94 | install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.1.0/cargo-dist-installer.sh | sh" 95 | - os: "macos-11" 96 | dist-args: "--artifacts=local --target=x86_64-apple-darwin" 97 | install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.1.0/cargo-dist-installer.sh | sh" 98 | - os: "windows-2019" 99 | dist-args: "--artifacts=local --target=x86_64-pc-windows-msvc" 100 | install-dist: "irm https://github.com/axodotdev/cargo-dist/releases/download/v0.1.0/cargo-dist-installer.ps1 | iex" 101 | - os: "ubuntu-20.04" 102 | dist-args: "--artifacts=local --target=x86_64-unknown-linux-gnu" 103 | install-dist: "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v0.1.0/cargo-dist-installer.sh | sh" 104 | 105 | runs-on: ${{ matrix.os }} 106 | env: 107 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 108 | steps: 109 | - uses: actions/checkout@v3 110 | with: 111 | submodules: recursive 112 | - name: Install cargo-dist 113 | run: ${{ matrix.install-dist }} 114 | - name: Run cargo-dist 115 | # This logic is a bit janky because it's trying to be a polyglot between 116 | # powershell and bash since this will run on windows, macos, and linux! 117 | # The two platforms don't agree on how to talk about env vars but they 118 | # do agree on 'cat' and '$()' so we use that to marshal values between commands. 119 | run: | 120 | # Actually do builds and make zips and whatnot 121 | cargo dist build --tag=${{ github.ref_name }} --output-format=json ${{ matrix.dist-args }} > dist-manifest.json 122 | echo "dist ran successfully" 123 | cat dist-manifest.json 124 | 125 | # Parse out what we just built and upload it to the Github Release™ 126 | jq --raw-output ".artifacts[]?.path | select( . != null )" dist-manifest.json > uploads.txt 127 | echo "uploading..." 128 | cat uploads.txt 129 | gh release upload ${{ github.ref_name }} $(cat uploads.txt) 130 | echo "uploaded!" 131 | 132 | # Mark the Github Release™ as a non-draft now that everything has succeeded! 133 | publish-release: 134 | # Only run after all the other tasks, but it's ok if upload-artifacts was skipped 135 | needs: [create-release, upload-artifacts] 136 | if: ${{ always() && needs.create-release.result == 'success' && (needs.upload-artifacts.result == 'skipped' || needs.upload-artifacts.result == 'success') }} 137 | runs-on: ubuntu-latest 138 | env: 139 | GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} 140 | steps: 141 | - uses: actions/checkout@v3 142 | with: 143 | submodules: recursive 144 | - name: mark release as non-draft 145 | run: | 146 | gh release edit ${{ github.ref_name }} --draft=false 147 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | mod arbitrary; 2 | mod fuzzer; 3 | mod stats; 4 | mod verifier; 5 | 6 | use std::collections::HashMap; 7 | use std::path::PathBuf; 8 | use std::process::ExitCode; 9 | use std::str::FromStr; 10 | use std::{fs, time::Instant}; 11 | 12 | use anyhow::{Context, Result}; 13 | use argh::FromArgs; 14 | use fuzzer::Fuzzer; 15 | use openapi_utils::SpecExt; 16 | use openapiv3::OpenAPI; 17 | use url::{ParseError, Url}; 18 | 19 | use crate::fuzzer::FuzzResult; 20 | 21 | #[derive(FromArgs, PartialEq, Debug)] 22 | /// openapi-fuzzer - black-box fuzzer that fuzzes APIs based on OpenAPI Specification 23 | struct Cli { 24 | #[argh(subcommand)] 25 | subcommands: Subcommands, 26 | } 27 | 28 | #[derive(FromArgs, PartialEq, Debug)] 29 | #[argh(subcommand)] 30 | enum Subcommands { 31 | Run(RunArgs), 32 | Resend(ResendArgs), 33 | } 34 | 35 | #[derive(FromArgs, Debug, PartialEq)] 36 | /// run openapi-fuzzer 37 | #[argh(subcommand, name = "run")] 38 | struct RunArgs { 39 | /// path to OpenAPI specification file 40 | #[argh(option, short = 's')] 41 | spec: PathBuf, 42 | 43 | /// url of api to fuzz 44 | #[argh(option, short = 'u')] 45 | url: UrlWithTrailingSlash, 46 | 47 | /// status codes that will not be considered as finding 48 | #[argh(option, short = 'i')] 49 | ignore_status_code: Vec, 50 | 51 | /// additional header to send 52 | #[argh(option, short = 'H')] 53 | header: Vec
, 54 | 55 | /// maximum number of test cases that will run for each combination of endpoint 56 | /// and method (default: 256) 57 | #[argh(option, default = "256")] 58 | max_test_case_count: u32, 59 | 60 | /// directory for results with minimal generated payload used for resending 61 | /// requests (default: results). 62 | #[argh(option, short = 'o', default = "String::from(\"results\").into()")] 63 | results_dir: PathBuf, 64 | 65 | /// directory for request times statistics. if no value is supplied, statistics 66 | /// will not be saved 67 | #[argh(option)] 68 | stats_dir: Option, 69 | 70 | #[argh(switch, description = "disable verification of TLS certificates")] 71 | skip_tls_verify: bool, 72 | 73 | /// do not use rate limiting 74 | #[argh(switch)] 75 | no_rate_limiting: bool, 76 | } 77 | 78 | #[derive(FromArgs, Debug, PartialEq)] 79 | /// resend payload genereted by fuzzer 80 | #[argh(subcommand, name = "resend")] 81 | struct ResendArgs { 82 | /// path to result file generated by fuzzer 83 | #[argh(positional)] 84 | file: PathBuf, 85 | 86 | /// extra header 87 | #[argh(option, short = 'H')] 88 | header: Vec
, 89 | 90 | /// url of api 91 | #[argh(option, short = 'u')] 92 | url: UrlWithTrailingSlash, 93 | 94 | #[argh(switch, description = "disable verification of TLS certificates")] 95 | skip_tls_verify: bool, 96 | } 97 | 98 | #[derive(Debug, PartialEq)] 99 | struct Header(String, String); 100 | 101 | impl FromStr for Header { 102 | type Err = String; 103 | 104 | fn from_str(s: &str) -> Result { 105 | let parts: Vec<_> = s.splitn(2, ':').collect(); 106 | if parts.len() != 2 { 107 | return Err("invalid header format".to_string()); 108 | } 109 | Ok(Header( 110 | parts[0].to_string().to_lowercase(), 111 | parts[1].to_string(), 112 | )) 113 | } 114 | } 115 | 116 | impl From
for (String, String) { 117 | fn from(val: Header) -> Self { 118 | (val.0, val.1) 119 | } 120 | } 121 | 122 | #[derive(Debug, PartialEq)] 123 | struct UrlWithTrailingSlash(Url); 124 | 125 | impl FromStr for UrlWithTrailingSlash { 126 | type Err = ParseError; 127 | 128 | fn from_str(s: &str) -> Result { 129 | if s.ends_with('/') { 130 | Ok(UrlWithTrailingSlash(Url::from_str(s)?)) 131 | } else { 132 | Ok(UrlWithTrailingSlash(Url::from_str(&(s.to_owned() + "/"))?)) 133 | } 134 | } 135 | } 136 | 137 | impl From for Url { 138 | fn from(val: UrlWithTrailingSlash) -> Self { 139 | val.0 140 | } 141 | } 142 | 143 | fn main() -> Result { 144 | let args: Cli = argh::from_env(); 145 | 146 | let exit_code = match args.subcommands { 147 | Subcommands::Run(args) => { 148 | let specfile = std::fs::read_to_string(&args.spec) 149 | .context(format!("Unable to read {:?}", &args.spec))?; 150 | let openapi_schema: OpenAPI = 151 | serde_yaml::from_str(&specfile).context("Failed to parse schema")?; 152 | let openapi_schema = openapi_schema.deref_all(); 153 | 154 | let request_sender = create_sender( 155 | create_agent(!args.skip_tls_verify), 156 | args.url.into(), 157 | args.header.into_iter().map(Into::into).collect(), 158 | args.no_rate_limiting, 159 | ); 160 | let now = Instant::now(); 161 | let exit_code = Fuzzer::new( 162 | openapi_schema, 163 | args.ignore_status_code, 164 | args.max_test_case_count, 165 | args.results_dir, 166 | args.stats_dir, 167 | request_sender, 168 | ) 169 | .run()?; 170 | println!("Elapsed time: {}s", now.elapsed().as_secs()); 171 | exit_code 172 | } 173 | Subcommands::Resend(args) => { 174 | let json = fs::read_to_string(&args.file) 175 | .context(format!("Unable to read {:?}", &args.file))?; 176 | let result: FuzzResult = serde_json::from_str(&json)?; 177 | 178 | let agent = create_agent(!args.skip_tls_verify); 179 | 180 | let response = Fuzzer::send_request( 181 | &args.url.into(), 182 | result.path, 183 | result.method, 184 | &result.payload, 185 | &args.header.into_iter().map(Into::into).collect(), 186 | &agent, 187 | )?; 188 | eprintln!("{} ({})", response.status(), response.status_text()); 189 | println!("{}", response.into_string()?); 190 | ExitCode::SUCCESS 191 | } 192 | }; 193 | 194 | Ok(exit_code) 195 | } 196 | 197 | fn create_agent(verify_cert: bool) -> ureq::Agent { 198 | if verify_cert { 199 | ureq::agent() 200 | } else { 201 | let conf = verifier::skip_tls_verification_config(); 202 | ureq::AgentBuilder::new() 203 | .tls_config(std::sync::Arc::new(conf)) 204 | .build() 205 | } 206 | } 207 | 208 | fn create_sender( 209 | agent: ureq::Agent, 210 | url: Url, 211 | extra_headers: HashMap, 212 | no_rate_limiting: bool, 213 | ) -> fuzzer::RequestSender { 214 | if no_rate_limiting { 215 | Box::new(move |path_with_params, method, payload| { 216 | Fuzzer::send_request( 217 | &url, 218 | path_with_params, 219 | method, 220 | payload, 221 | &extra_headers, 222 | &agent, 223 | ) 224 | }) 225 | } else { 226 | Box::new(move |path_with_params, method, payload| { 227 | Fuzzer::send_request_with_backoff( 228 | &url, 229 | path_with_params, 230 | method, 231 | payload, 232 | &extra_headers, 233 | &agent, 234 | ) 235 | }) 236 | } 237 | } 238 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # OpenAPI fuzzer 2 | 3 | ![ci](https://github.com/matusf/openapi-fuzzer/actions/workflows/ci.yml/badge.svg) 4 | 5 | Black-box fuzzer that fuzzes APIs based on [OpenAPI specification](https://github.com/OAI/OpenAPI-Specification/). All you need to do is to supply URL of the API and its specification. Find bugs for free! 6 | 7 | ![image](https://user-images.githubusercontent.com/18228995/225413315-eab08df2-ed56-4b7a-8c8a-027c18d9a106.png) 8 | 9 | ## Findings 10 | 11 | The fuzzer has been used to find bugs in numerous software. Some of the well-known fuzzed software include[^1]: 12 | 13 |
Kubernetes 14 | 15 | - [kubenetes#101350](https://github.com/kubernetes/kubernetes/issues/101350) 16 | - [kubenetes#101348](https://github.com/kubernetes/kubernetes/issues/101348) 17 | - [kubenetes#101355](https://github.com/kubernetes/kubernetes/issues/101355) 18 | 19 |
20 | 21 |
Gitea 22 | 23 | - [gitea#15357](https://github.com/go-gitea/gitea/issues/15357) 24 | - [gitea#15356](https://github.com/go-gitea/gitea/issues/15356) 25 | - [gitea#15346](https://github.com/go-gitea/gitea/issues/15346) 26 | 27 |
28 | 29 |
Vault 30 | 31 | - [vault#11310](https://github.com/hashicorp/vault/issues/11310) 32 | - [vault#11311](https://github.com/hashicorp/vault/issues/11311) 33 | - [vault#11313](https://github.com/hashicorp/vault/issues/11313) 34 | 35 |
36 | 37 | The category of bugs differ, but some of the common are parsing bugs, invalid format bugs and querying non-existent entities. **If you have found bugs with this fuzzer, please reach out to me. I would love to hear from you.** Feel free to submit a PR and add your finding to the list above. 38 | 39 | ## Building & installing 40 | 41 | ### From crates.io 42 | 43 | To build the fuzzer, you will need to have [rust installed](https://www.rust-lang.org/learn/get-started). 44 | 45 | ```sh 46 | cargo install openapi-fuzzer 47 | ``` 48 | 49 | ### From source 50 | 51 | ```sh 52 | git clone git@github.com:matusf/openapi-fuzzer.git 53 | cd openapi-fuzzer 54 | 55 | # Install to the $PATH 56 | cargo install --path . 57 | 58 | # Or build inside the repo 59 | cargo build --release 60 | ``` 61 | 62 | ### Using containers 63 | 64 | ```sh 65 | podman pull ghcr.io/matusf/openapi-fuzzer 66 | ``` 67 | 68 | ## Usage 69 | 70 | After installation you will have the `openapi-fuzzer` binary available to you, which offers two subcommands - `run` and `resend`. The `run` subcommand will fuzz the API according to the specification and report any findings. All findings will be stored in a JSON format in a `results` directory (the name of the directory can be specified by `--results-dir` flag). 71 | 72 | If the fuzzer finds a bug it will save the seed that leads to the generation of the payload triggering the bug. Those seeds are saved in a regressions file called `openapi-fuzzer.regressions`. The seeds will be used in the next runs of the fuzzer to check if the bug persists. You shall save it alongside your project. 73 | 74 | When you are done with fuzzing, you can use `openapi-fuzzer resend` to resend payloads that triggered bugs and examine the cause in depth. 75 | 76 | OpenAPI fuzzer supports version 3 of the OpenAPI specification in YAML or JSON format. You can convert older versions at [editor.swagger.io](https://editor.swagger.io/). 77 | 78 | ### Tips 79 | 80 | - When the fuzzer receives an unexpected status code, it will report it as a finding. However, many APIs do not specify client error status codes in the specification. To minimize false positive findings ignore status codes that you are not interested in with `-i` flag. It is advised to fuzz it in two stages. Firstly, run the fuzzer without `-i` flag. Then check the `results` folder for the reported findings. If there are reports from status codes you do not care about, add them via `-i` flag and rerun the fuzzer. 81 | - Most APIs use some base prefix for endpoints like `/v1` or `/api`, however, the specifications are sometimes written without it. Do not forget to **include the path prefix in the url**. 82 | - You may add an extra header with `-H` flag. It may be useful when you would like to increase coverage by providing some sort of authorization. You can use the `-H` flag to add cookies too. e.g. `-H "Cookie: A=1;"`. Use a single `-H` flag when adding multiple cookies as well. e.g. `-H "Cookie: A=1; B=2; C=3;"`. 83 | - Currently, the fuzzer makes 256 requests per endpoint. If all received responses are expected, it declares the endpoint as ok and continues to fuzz the next one. You can adjust this number by setting a `--max-test-case-count` flag. 84 | - To disable the verification of TLS certificates and thus use, for example, self-signed certificates, you can use the `--skip-tls-verify` flag. 85 | - By default, the fuzzer uses rate limiting. If it receives an HTTP status code of 429 or 503, it will wait for a number of seconds specified by the `Retry-After` header. If the header is not present, it will use an exponential backoff algorithm with a starting value of 1 second. After 10 unsuccessful retries, fuzzing of the endpoint is aborted. 86 | 87 | ```console 88 | $ openapi-fuzzer run --help 89 | Usage: openapi-fuzzer run -s -u [-i ] [-H
] [--max-test-case-count ] [-o ] [--stats-dir ] [--skip-tls-verify] [--no-rate-limiting] 90 | 91 | run openapi-fuzzer 92 | 93 | Options: 94 | -s, --spec path to OpenAPI specification file 95 | -u, --url url of api to fuzz 96 | -i, --ignore-status-code 97 | status codes that will not be considered as finding 98 | -H, --header additional header to send 99 | --max-test-case-count 100 | maximum number of test cases that will run for each 101 | combination of endpoint and method (default: 256) 102 | -o, --results-dir directory for results with minimal generated payload used 103 | for resending requests (default: results). 104 | --stats-dir directory for request times statistics. if no value is 105 | supplied, statistics will not be saved 106 | --skip-tls-verify disable verification of TLS certificates 107 | --no-rate-limiting 108 | do not use rate limiting 109 | --help display usage information 110 | 111 | $ openapi-fuzzer run -s ./spec.yaml -u http://127.0.0.1:8200/v1/ -i 404 -i 400 -H "Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==" 112 | ``` 113 | 114 | ### Replaying findings 115 | 116 | When you are done fuzzing you can replay the findings. All findings are stored in the `results` folder. Name of each file consists of concatenated endpoint, HTTP method and received status code. To resend the same payload to API, you need to run `openapi-fuzzer resend` and specify a path to the finding file as an argument and a url of the api. You can overwrite the headers with `-H` flag as well, which is useful, when you need authorization. 117 | 118 | ```console 119 | $ ls -1 results/ 120 | api-v1-componentstatuses-{name}-GET-500.json 121 | api-v1-namespaces-{namespace}-configmaps-GET-500.json 122 | api-v1-namespaces-{namespace}-endpoints-GET-500.json 123 | api-v1-namespaces-{namespace}-events-GET-500.json 124 | api-v1-namespaces-{namespace}-limitranges-GET-500.json 125 | api-v1-namespaces-{namespace}-persistentvolumeclaims-GET-500.json 126 | api-v1-namespaces-{namespace}-pods-GET-500.json 127 | api-v1-namespaces-{namespace}-podtemplates-GET-500.json 128 | api-v1-namespaces-{namespace}-replicationcontrollers-GET-500.json 129 | api-v1-namespaces-{namespace}-resourcequotas-GET-500.json 130 | api-v1-namespaces-{namespace}-secrets-GET-500.json 131 | api-v1-namespaces-{namespace}-serviceaccounts-GET-500.json 132 | api-v1-namespaces-{namespace}-services-GET-500.json 133 | api-v1-watch-namespaces-{name}-GET-500.json 134 | ... 135 | 136 | $ openapi-fuzzer resend --help 137 | Usage: openapi-fuzzer resend [-H ] -u 138 | 139 | resend payload genereted by fuzzer 140 | 141 | Positional Arguments: 142 | file path to result file generated by fuzzer 143 | 144 | Options: 145 | -H, --header extra header 146 | -u, --url url of api 147 | --help display usage information 148 | 149 | $ openapi-fuzzer resend --url https://minikubeca:8443 results/api-v1-componentstatuses-\{name\}-GET-500.json -H "Authorization: Bearer $KUBE_TOKEN" | jq 150 | 500 (Internal Server Error) 151 | { 152 | "kind": "Status", 153 | "apiVersion": "v1", 154 | "metadata": {}, 155 | "status": "Failure", 156 | "message": "Component not found: ኊ0", 157 | "code": 500 158 | } 159 | ``` 160 | 161 | [^1]: not all found bugs are linked 162 | -------------------------------------------------------------------------------- /src/fuzzer.rs: -------------------------------------------------------------------------------- 1 | use std::{ 2 | borrow::Cow, 3 | cell::RefCell, 4 | collections::HashMap, 5 | fs::{self, File}, 6 | mem, 7 | path::{Path, PathBuf}, 8 | process::ExitCode, 9 | rc::Rc, 10 | thread, 11 | time::{Duration, Instant}, 12 | }; 13 | 14 | use anyhow::{anyhow, Context, Error, Result}; 15 | use indexmap::IndexMap; 16 | use openapi_utils::ReferenceOrExt; 17 | use openapiv3::{OpenAPI, ReferenceOr, Response, StatusCode}; 18 | use proptest::{ 19 | prelude::any_with, 20 | test_runner::{Config, FileFailurePersistence, TestCaseError, TestError, TestRunner}, 21 | }; 22 | use serde::{Deserialize, Serialize}; 23 | use ureq::{Agent, OrAnyStatus}; 24 | use url::Url; 25 | 26 | use crate::{ 27 | arbitrary::{ArbitraryParameters, Payload}, 28 | stats::Stats, 29 | }; 30 | 31 | const BACKOFF_STATUS_CODES: [u16; 2] = [429, 503]; 32 | 33 | #[derive(Debug, Deserialize, Serialize)] 34 | pub struct FuzzResult<'a> { 35 | pub payload: Payload, 36 | pub path: &'a str, 37 | pub method: &'a str, 38 | } 39 | 40 | #[derive(Debug, Default, Serialize)] 41 | pub struct FuzzStats { 42 | times: Vec, 43 | did_failed: Vec, 44 | } 45 | 46 | pub type RequestSender = Box Result>; 47 | 48 | pub struct Fuzzer { 49 | schema: OpenAPI, 50 | ignored_status_codes: Vec, 51 | max_test_case_count: u32, 52 | results_dir: PathBuf, 53 | stats_dir: Option, 54 | request_sender: RequestSender, 55 | } 56 | 57 | impl Fuzzer { 58 | pub fn new( 59 | schema: OpenAPI, 60 | ignored_status_codes: Vec, 61 | max_test_case_count: u32, 62 | results_dir: PathBuf, 63 | stats_dir: Option, 64 | request_sender: RequestSender, 65 | ) -> Fuzzer { 66 | Fuzzer { 67 | schema, 68 | ignored_status_codes, 69 | max_test_case_count, 70 | results_dir, 71 | stats_dir, 72 | request_sender, 73 | } 74 | } 75 | 76 | pub fn run(&mut self) -> Result { 77 | fs::create_dir_all(&self.results_dir).context(format!( 78 | "Unable to create directory: {:?}", 79 | self.results_dir 80 | ))?; 81 | if let Some(dir) = &self.stats_dir { 82 | fs::create_dir_all(dir) 83 | .context(format!("Unable to create directory: {:?}", self.stats_dir))?; 84 | }; 85 | 86 | let config = Config { 87 | failure_persistence: Some(Box::new(FileFailurePersistence::Direct( 88 | "openapi-fuzzer.regressions", 89 | ))), 90 | verbose: 0, 91 | cases: self.max_test_case_count, 92 | ..Config::default() 93 | }; 94 | let mut test_failed = false; 95 | let paths = mem::take(&mut self.schema.paths); 96 | let max_path_length = paths.iter().map(|(path, _)| path.len()).max().unwrap_or(0); 97 | 98 | println!("\x1B[1mMETHOD {path:max_path_length$} STATUS MEAN (μs) STD.DEV. MIN (μs) MAX (μs)\x1B[0m", 99 | path = "PATH" 100 | ); 101 | for (path_with_params, mut ref_or_item) in paths { 102 | let path_with_params = path_with_params.trim_start_matches('/'); 103 | let item = ref_or_item.to_item_mut(); 104 | let operations = vec![ 105 | ("GET", item.get.take()), 106 | ("PUT", item.put.take()), 107 | ("POST", item.post.take()), 108 | ("DELETE", item.delete.take()), 109 | ("OPTIONS", item.options.take()), 110 | ("HEAD", item.head.take()), 111 | ("PATCH", item.patch.take()), 112 | ("TRACE", item.trace.take()), 113 | ]; 114 | 115 | for (method, mut operation) in operations 116 | .into_iter() 117 | .filter_map(|(method, operation)| operation.map(|operation| (method, operation))) 118 | { 119 | let responses = mem::take(&mut operation.responses.responses); 120 | 121 | let stats = RefCell::new(FuzzStats::default()); 122 | 123 | let result = TestRunner::new(config.clone()).run( 124 | &any_with::(Rc::new(ArbitraryParameters::new(operation))), 125 | |payload| { 126 | let now = Instant::now(); 127 | let response = (self.request_sender)(path_with_params, method, &payload) 128 | .map_err(|e| { 129 | TestCaseError::Fail(format!("unable to send request: {e}").into()) 130 | })?; 131 | 132 | let is_expected_response = self.is_expected_response(&response, &responses); 133 | stats.borrow_mut().times.push(now.elapsed().as_micros()); 134 | stats.borrow_mut().did_failed.push(!is_expected_response); 135 | 136 | is_expected_response 137 | .then_some(()) 138 | .ok_or(TestCaseError::Fail(response.status().to_string().into())) 139 | }, 140 | ); 141 | let stats = stats.into_inner(); 142 | if let Some(dir) = &self.stats_dir { 143 | Fuzzer::save_stats(dir, path_with_params, method, &stats)?; 144 | } 145 | 146 | test_failed |= result.is_err(); 147 | self.report_run( 148 | method, 149 | path_with_params, 150 | result, 151 | max_path_length, 152 | &stats.times, 153 | )?; 154 | } 155 | } 156 | 157 | if test_failed { 158 | Ok(ExitCode::FAILURE) 159 | } else { 160 | Ok(ExitCode::SUCCESS) 161 | } 162 | } 163 | 164 | pub fn send_request_with_backoff( 165 | url: &Url, 166 | path_with_params: &str, 167 | method: &str, 168 | payload: &Payload, 169 | extra_headers: &HashMap, 170 | agent: &Agent, 171 | ) -> Result { 172 | let max_backoff = 10; 173 | 174 | for backoff in 0..max_backoff { 175 | let response = 176 | Fuzzer::send_request(url, path_with_params, method, payload, extra_headers, agent)?; 177 | if !BACKOFF_STATUS_CODES.contains(&response.status()) { 178 | return Ok(response); 179 | } 180 | 181 | let wait_seconds = response 182 | .header("Retry-After") 183 | .and_then(|s| s.parse::().ok()) 184 | .unwrap_or(1 << backoff); 185 | thread::sleep(Duration::from_millis(wait_seconds * 1000)); 186 | } 187 | 188 | Err(anyhow!("max backoff threshold reached")) 189 | } 190 | 191 | pub fn send_request( 192 | url: &Url, 193 | path_with_params: &str, 194 | method: &str, 195 | payload: &Payload, 196 | extra_headers: &HashMap, 197 | agent: &Agent, 198 | ) -> Result { 199 | let mut path_with_params = path_with_params.to_owned(); 200 | for (name, value) in payload.path_params().iter() { 201 | path_with_params = path_with_params.replace(&format!("{{{name}}}"), value); 202 | } 203 | let mut request = agent.request_url(method, &url.join(&path_with_params)?); 204 | 205 | for (param, value) in payload.query_params().iter() { 206 | request = request.query(param, value); 207 | } 208 | 209 | // Add headers overriding genereted ones with extra headers from command line 210 | for (header, value) in payload.headers().iter() { 211 | let value = extra_headers.get(&header.to_lowercase()).unwrap_or(value); 212 | request = request.set(header, value); 213 | } 214 | 215 | // Add remaining extra headers 216 | for (header, value) in extra_headers.iter() { 217 | if request.header(header).is_none() { 218 | request = request.set(header, value); 219 | } 220 | } 221 | 222 | match payload.body() { 223 | Some(json) => request.send_json(json.clone()), 224 | None => request.call(), 225 | } 226 | .or_any_status() 227 | .map_err(Into::into) 228 | } 229 | 230 | fn is_expected_response( 231 | &self, 232 | resp: &ureq::Response, 233 | responses: &IndexMap>, 234 | ) -> bool { 235 | // known non 500 and ingored status codes are OK 236 | self.ignored_status_codes.contains(&resp.status()) 237 | || (responses.contains_key(&StatusCode::Code(resp.status())) 238 | && resp.status() / 100 != 5) 239 | } 240 | 241 | fn save_finding( 242 | &self, 243 | path: &str, 244 | method: &str, 245 | payload: Payload, 246 | status_code: u16, 247 | ) -> Result<()> { 248 | let file = format!( 249 | "{}-{method}-{status_code}.json", 250 | path.trim_matches('/').replace('/', "-") 251 | ); 252 | serde_json::to_writer_pretty( 253 | &File::create(self.results_dir.join(&file)) 254 | .context(format!("Unable to create file: {file:?}"))?, 255 | &FuzzResult { 256 | payload, 257 | path, 258 | method, 259 | }, 260 | ) 261 | .map_err(Into::into) 262 | } 263 | 264 | fn save_stats(dir: &Path, path: &str, method: &str, stats: &FuzzStats) -> Result<()> { 265 | let file = format!("{}-{method}.json", path.trim_matches('/').replace('/', "-")); 266 | 267 | serde_json::to_writer( 268 | &File::create(dir.join(&file)).context(format!("Unable to create file: {file:?}"))?, 269 | stats, 270 | ) 271 | .map_err(Into::into) 272 | } 273 | 274 | fn report_run( 275 | &self, 276 | method: &str, 277 | path_with_params: &str, 278 | result: Result<(), TestError>, 279 | max_path_length: usize, 280 | times: &[u128], 281 | ) -> Result<()> { 282 | let status = match result { 283 | Err(TestError::Fail(reason, payload)) => { 284 | let reason: Cow = reason.message().into(); 285 | let status_code = reason 286 | .parse::() 287 | .map_err(|_| Error::msg(reason.into_owned()))?; 288 | 289 | self.save_finding(path_with_params, method, payload, status_code)?; 290 | "failed" 291 | } 292 | Ok(()) => "ok", 293 | Err(TestError::Abort(_)) => "aborted", 294 | }; 295 | 296 | let Stats { 297 | min, 298 | max, 299 | mean, 300 | std_dev, 301 | } = Stats::compute(times).ok_or(Error::msg("no requests sent"))?; 302 | println!("{method:7} {path_with_params:max_path_length$} {status:^7} {mean:10.0} {std_dev:8.0} {min:8} {max:10}"); 303 | Ok(()) 304 | } 305 | } 306 | -------------------------------------------------------------------------------- /src/arbitrary.rs: -------------------------------------------------------------------------------- 1 | use std::{iter::FromIterator, rc::Rc}; 2 | 3 | use openapi_utils::ReferenceOrExt; 4 | use openapiv3::{ 5 | ArrayType, ObjectType, Operation, Parameter, ParameterData, ParameterSchemaOrContent, 6 | SchemaKind, Type, 7 | }; 8 | 9 | use proptest::{ 10 | arbitrary::any, 11 | collection::vec, 12 | prelude::{any_with, Arbitrary}, 13 | strategy::{BoxedStrategy, Just, Strategy, Union}, 14 | }; 15 | use serde::{Deserialize, Serialize}; 16 | 17 | pub struct ArbitraryParameters { 18 | operation: Operation, 19 | } 20 | 21 | impl ArbitraryParameters { 22 | pub fn new(operation: Operation) -> Self { 23 | ArbitraryParameters { operation } 24 | } 25 | } 26 | 27 | impl Default for ArbitraryParameters { 28 | fn default() -> Self { 29 | panic!("no default value for `ArbitraryParameters`") 30 | } 31 | } 32 | 33 | fn generate_json_object(object: &ObjectType) -> BoxedStrategy { 34 | let mut vec = Vec::with_capacity(object.properties.len()); 35 | for (name, schema) in &object.properties { 36 | let schema_kind = &schema.to_item_ref().schema_kind; 37 | vec.push((Just(name.clone()), schema_kind_to_json(schema_kind))); 38 | } 39 | vec.prop_map(|vec| serde_json::Value::Object(serde_json::Map::from_iter(vec))) 40 | .boxed() 41 | } 42 | 43 | fn generate_json_array(array: &ArrayType) -> BoxedStrategy { 44 | let items = array.items.to_item_ref(); 45 | let (min, max) = (array.min_items.unwrap_or(1), array.max_items.unwrap_or(10)); 46 | vec(schema_kind_to_json(&items.schema_kind), (min, max)) 47 | .prop_map(serde_json::Value::Array) 48 | .boxed() 49 | } 50 | 51 | fn schema_type_to_json(schema_type: &Type) -> BoxedStrategy { 52 | match schema_type { 53 | Type::Boolean {} => any::().prop_map_into::().boxed(), 54 | Type::Integer(_integer_type) => any::().prop_map_into::().boxed(), 55 | Type::Number(_number_type) => any::().prop_map_into::().boxed(), 56 | Type::String(_string_type) => any::().prop_map_into::().boxed(), 57 | Type::Object(object_type) => generate_json_object(object_type), 58 | Type::Array(array_type) => generate_json_array(array_type), 59 | } 60 | } 61 | 62 | fn schema_kind_to_json(schema_kind: &SchemaKind) -> BoxedStrategy { 63 | match schema_kind { 64 | SchemaKind::Any(_any) => any::().prop_map_into::().boxed(), 65 | SchemaKind::Type(schema_type) => schema_type_to_json(schema_type).boxed(), 66 | // TODO: AllOf should generate all schemas and merge them to one json object 67 | SchemaKind::AllOf { all_of: schemas } 68 | | SchemaKind::AnyOf { any_of: schemas } 69 | | SchemaKind::OneOf { one_of: schemas } => Union::new( 70 | schemas 71 | .iter() 72 | .map(|ref_of_schema| schema_kind_to_json(&ref_of_schema.to_item_ref().schema_kind)), 73 | ) 74 | .boxed(), 75 | } 76 | } 77 | 78 | fn any_json(schema_kind: &SchemaKind) -> impl Strategy { 79 | schema_kind_to_json(schema_kind) 80 | } 81 | 82 | fn parameter_data_to_strategy( 83 | parameter_data: &ParameterData, 84 | string_strategy: impl Strategy + 'static, 85 | ) -> (Just, impl Strategy) { 86 | let ParameterSchemaOrContent::Schema(schema) = ¶meter_data.format else { 87 | return (Just(parameter_data.name.clone()), string_strategy.boxed()); 88 | }; 89 | 90 | let SchemaKind::Type(schema_type) = &schema.to_item_ref().schema_kind else { 91 | return (Just(parameter_data.name.clone()), string_strategy.boxed()); 92 | }; 93 | 94 | let value = match &schema_type { 95 | Type::Boolean {} => any::().prop_map(|i| i.to_string()).boxed(), 96 | Type::Integer(_integer_type) => any::().prop_map(|i| i.to_string()).boxed(), 97 | Type::Number(_number_type) => any::().prop_map(|i| i.to_string()).boxed(), 98 | _ => string_strategy.boxed(), 99 | }; 100 | 101 | (Just(parameter_data.name.clone()), value) 102 | } 103 | 104 | #[derive(Debug, Default, Clone, Serialize, Deserialize)] 105 | struct OptionalJSON(Option); 106 | 107 | impl Arbitrary for OptionalJSON { 108 | type Parameters = Rc; 109 | 110 | fn arbitrary_with(args: Self::Parameters) -> Self::Strategy { 111 | if let Some(ref_or_body) = args.operation.request_body.as_ref() { 112 | let request_body = ref_or_body.to_item_ref(); 113 | for (media_type_name, media_type) in &request_body.content { 114 | if media_type_name.contains("json") { 115 | match media_type 116 | .schema 117 | .as_ref() 118 | .map(|schema| any_json(&schema.to_item_ref().schema_kind)) 119 | { 120 | Some(strategy) => { 121 | return strategy.prop_map(|json| OptionalJSON(Some(json))).boxed(); 122 | } 123 | None => continue, 124 | }; 125 | }; 126 | } 127 | }; 128 | 129 | Just(OptionalJSON(None)).boxed() 130 | } 131 | 132 | type Strategy = BoxedStrategy; 133 | } 134 | 135 | #[derive(Debug, Deserialize, Serialize)] 136 | struct Parameters { 137 | headers: Vec<(String, String)>, 138 | path: Vec<(String, String)>, 139 | query: Vec<(String, String)>, 140 | } 141 | 142 | impl Arbitrary for Parameters { 143 | type Parameters = Rc; 144 | 145 | fn arbitrary_with(args: Self::Parameters) -> Self::Strategy { 146 | let mut headers = vec![]; 147 | let mut path_parameters = vec![]; 148 | let mut query_parameters = vec![]; 149 | 150 | args.operation.parameters.iter().for_each(|ref_or_param| { 151 | match ref_or_param.to_item_ref() { 152 | Parameter::Header { parameter_data, .. } => { 153 | // Generate headers following the HTTP/1.1 RFC 154 | // https://datatracker.ietf.org/doc/html/rfc7230#section-3.2 155 | headers.push(parameter_data_to_strategy(parameter_data, "[!-~ \t]*")); 156 | } 157 | Parameter::Query { parameter_data, .. } => { 158 | query_parameters.push(parameter_data_to_strategy(parameter_data, ".*")); 159 | } 160 | Parameter::Path { parameter_data, .. } => { 161 | path_parameters.push(parameter_data_to_strategy(parameter_data, ".*")); 162 | } 163 | Parameter::Cookie { .. } => {} 164 | }; 165 | }); 166 | 167 | (headers, path_parameters, query_parameters) 168 | .prop_map(|(headers, path, query)| Parameters { 169 | headers, 170 | path, 171 | query, 172 | }) 173 | .boxed() 174 | } 175 | 176 | type Strategy = BoxedStrategy; 177 | } 178 | 179 | #[derive(Debug, Deserialize, Serialize)] 180 | pub struct Payload { 181 | parameters: Parameters, 182 | body: OptionalJSON, 183 | } 184 | 185 | impl Arbitrary for Payload { 186 | type Parameters = Rc; 187 | type Strategy = BoxedStrategy; 188 | 189 | fn arbitrary_with(args: Self::Parameters) -> Self::Strategy { 190 | let args = args; 191 | any_with::<(Parameters, OptionalJSON)>((args.clone(), args)) 192 | .prop_map(|(parameters, body)| Payload { parameters, body }) 193 | .boxed() 194 | } 195 | } 196 | 197 | impl Payload { 198 | pub fn query_params(&self) -> &[(String, String)] { 199 | &self.parameters.query 200 | } 201 | 202 | pub fn path_params(&self) -> &[(String, String)] { 203 | &self.parameters.path 204 | } 205 | 206 | pub fn headers(&self) -> &[(String, String)] { 207 | &self.parameters.headers 208 | } 209 | 210 | pub fn body(&self) -> Option<&serde_json::Value> { 211 | self.body.0.as_ref() 212 | } 213 | } 214 | 215 | #[cfg(test)] 216 | mod test { 217 | use super::*; 218 | use anyhow::Result; 219 | use indexmap::indexmap; 220 | use openapiv3::{ 221 | HeaderStyle, IntegerType, NumberType, ParameterData, ParameterSchemaOrContent, PathStyle, 222 | QueryStyle, ReferenceOr, Schema, SchemaData, StringType, 223 | }; 224 | use proptest::{ 225 | prop_assert, proptest, 226 | test_runner::{Config, FileFailurePersistence, TestError, TestRunner}, 227 | }; 228 | 229 | #[test] 230 | fn test_json_string() { 231 | let mut runner = TestRunner::new(Config { 232 | failure_persistence: Some(Box::new(FileFailurePersistence::Off)), 233 | ..Config::default() 234 | }); 235 | 236 | let result = runner.run( 237 | &any_json(&SchemaKind::Type(Type::String(StringType::default()))), 238 | |s| { 239 | if let serde_json::Value::String(str) = s { 240 | assert!(!serde_json::from_str::(&str).unwrap().is_empty()) 241 | } 242 | Ok(()) 243 | }, 244 | ); 245 | 246 | match result { 247 | Err(TestError::Fail(_, value)) => { 248 | println!("Found minimal failing case: {value}"); 249 | } 250 | result => panic!("Unexpected result: {:?}", result), 251 | } 252 | } 253 | 254 | #[test] 255 | fn test_json_object() -> Result<()> { 256 | let mut runner = TestRunner::new(Config { 257 | failure_persistence: Some(Box::new(FileFailurePersistence::Off)), 258 | ..Config::default() 259 | }); 260 | 261 | let s: SchemaKind = SchemaKind::Type(Type::Object(ObjectType { 262 | properties: indexmap! { 263 | "date".to_string() => ReferenceOr::Item(Box::new(Schema { 264 | schema_kind: SchemaKind::Type(Type::String(StringType::default())), 265 | schema_data: Default::default(), 266 | })), 267 | "temperatureC".to_string() => ReferenceOr::Item(Box::new(Schema { 268 | schema_kind: SchemaKind::Type(Type::Integer(IntegerType::default())), 269 | schema_data: Default::default(), 270 | })), 271 | }, 272 | ..Default::default() 273 | })); 274 | 275 | let result = runner.run(&any_json(&s), |obj| { 276 | if let serde_json::Value::Object(map) = obj { 277 | assert!(map.get("temperatureC").unwrap().as_i64() >= Some(0)); 278 | } 279 | Ok(()) 280 | }); 281 | 282 | match result { 283 | Err(TestError::Fail(_, value)) => { 284 | println!("Found minimal failing case: {value}"); 285 | Ok(()) 286 | } 287 | result => panic!("Unexpected result: {:?}", result), 288 | } 289 | } 290 | 291 | enum ParameterType { 292 | Query, 293 | Header, 294 | Path, 295 | } 296 | 297 | fn create_parameter( 298 | parameter_type: ParameterType, 299 | name: &str, 300 | schema_kind: Option, 301 | ) -> ReferenceOr { 302 | let format = match schema_kind { 303 | Some(schema_kind) => ParameterSchemaOrContent::Schema(ReferenceOr::Item(Schema { 304 | schema_data: SchemaData::default(), 305 | schema_kind: schema_kind, 306 | })), 307 | None => ParameterSchemaOrContent::Content(Default::default()), 308 | }; 309 | 310 | match parameter_type { 311 | ParameterType::Query => ReferenceOr::Item(Parameter::Query { 312 | parameter_data: ParameterData { 313 | name: name.into(), 314 | description: None, 315 | required: false, 316 | deprecated: None, 317 | format, 318 | example: None, 319 | examples: Default::default(), 320 | explode: None, 321 | extensions: Default::default(), 322 | }, 323 | style: QueryStyle::Form, 324 | allow_reserved: false, 325 | allow_empty_value: None, 326 | }), 327 | ParameterType::Header => ReferenceOr::Item(Parameter::Header { 328 | parameter_data: ParameterData { 329 | name: name.into(), 330 | description: None, 331 | required: false, 332 | deprecated: None, 333 | format, 334 | example: None, 335 | examples: Default::default(), 336 | explode: None, 337 | extensions: Default::default(), 338 | }, 339 | style: HeaderStyle::Simple, 340 | }), 341 | ParameterType::Path => ReferenceOr::Item(Parameter::Path { 342 | parameter_data: ParameterData { 343 | name: name.into(), 344 | description: None, 345 | required: false, 346 | deprecated: None, 347 | format, 348 | example: None, 349 | examples: Default::default(), 350 | explode: None, 351 | extensions: Default::default(), 352 | }, 353 | style: PathStyle::Simple, 354 | }), 355 | } 356 | } 357 | 358 | fn create_parameters() -> BoxedStrategy { 359 | let operation = Operation { 360 | parameters: vec![ 361 | create_parameter(ParameterType::Header, "string-header", None), 362 | create_parameter(ParameterType::Path, "string-path", None), 363 | create_parameter( 364 | ParameterType::Path, 365 | "float", 366 | Some(SchemaKind::Type(Type::Number(NumberType::default()))), 367 | ), 368 | create_parameter( 369 | ParameterType::Path, 370 | "int", 371 | Some(SchemaKind::Type(Type::Integer(IntegerType::default()))), 372 | ), 373 | create_parameter( 374 | ParameterType::Path, 375 | "bool", 376 | Some(SchemaKind::Type(Type::Boolean {})), 377 | ), 378 | create_parameter( 379 | ParameterType::Query, 380 | "float", 381 | Some(SchemaKind::Type(Type::Number(NumberType::default()))), 382 | ), 383 | create_parameter( 384 | ParameterType::Query, 385 | "int", 386 | Some(SchemaKind::Type(Type::Integer(IntegerType::default()))), 387 | ), 388 | create_parameter( 389 | ParameterType::Query, 390 | "bool", 391 | Some(SchemaKind::Type(Type::Boolean {})), 392 | ), 393 | ], 394 | ..Default::default() 395 | }; 396 | Parameters::arbitrary_with(Rc::new(ArbitraryParameters { operation })) 397 | } 398 | 399 | fn is_valid_header_value_char(b: u8) -> bool { 400 | match b { 401 | b' ' | b'\t' | 33..=126 => true, 402 | _ => false, 403 | } 404 | } 405 | 406 | proptest! { 407 | #[test] 408 | fn test_parameters(parameters in create_parameters()) { 409 | for (name, value) in parameters.path.into_iter().chain(parameters.headers).chain(parameters.query) { 410 | if name == "float" { 411 | prop_assert!(value.parse::().is_ok()); 412 | } 413 | if name == "int" { 414 | prop_assert!(value.parse::().is_ok()); 415 | } 416 | if name == "bool" { 417 | prop_assert!(value.parse::().is_ok()); 418 | } 419 | if name == "string-header"{ 420 | prop_assert!(value.bytes().all(is_valid_header_value_char)); 421 | } 422 | } 423 | } 424 | } 425 | } 426 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | version = 3 4 | 5 | [[package]] 6 | name = "adler" 7 | version = "1.0.2" 8 | source = "registry+https://github.com/rust-lang/crates.io-index" 9 | checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" 10 | 11 | [[package]] 12 | name = "anyhow" 13 | version = "1.0.37" 14 | source = "registry+https://github.com/rust-lang/crates.io-index" 15 | checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86" 16 | 17 | [[package]] 18 | name = "arbitrary" 19 | version = "1.2.2" 20 | source = "registry+https://github.com/rust-lang/crates.io-index" 21 | checksum = "b0224938f92e7aef515fac2ff2d18bd1115c1394ddf4a092e0c87e8be9499ee5" 22 | 23 | [[package]] 24 | name = "argh" 25 | version = "0.1.4" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "91792f088f87cdc7a2cfb1d617fa5ea18d7f1dc22ef0e1b5f82f3157cdc522be" 28 | dependencies = [ 29 | "argh_derive", 30 | "argh_shared", 31 | ] 32 | 33 | [[package]] 34 | name = "argh_derive" 35 | version = "0.1.4" 36 | source = "registry+https://github.com/rust-lang/crates.io-index" 37 | checksum = "c4eb0c0c120ad477412dc95a4ce31e38f2113e46bd13511253f79196ca68b067" 38 | dependencies = [ 39 | "argh_shared", 40 | "heck", 41 | "proc-macro2", 42 | "quote", 43 | "syn 1.0.107", 44 | ] 45 | 46 | [[package]] 47 | name = "argh_shared" 48 | version = "0.1.4" 49 | source = "registry+https://github.com/rust-lang/crates.io-index" 50 | checksum = "781f336cc9826dbaddb9754cb5db61e64cab4f69668bd19dcc4a0394a86f4cb1" 51 | 52 | [[package]] 53 | name = "autocfg" 54 | version = "1.0.1" 55 | source = "registry+https://github.com/rust-lang/crates.io-index" 56 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 57 | 58 | [[package]] 59 | name = "base64" 60 | version = "0.21.4" 61 | source = "registry+https://github.com/rust-lang/crates.io-index" 62 | checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" 63 | 64 | [[package]] 65 | name = "bit-set" 66 | version = "0.5.2" 67 | source = "registry+https://github.com/rust-lang/crates.io-index" 68 | checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" 69 | dependencies = [ 70 | "bit-vec", 71 | ] 72 | 73 | [[package]] 74 | name = "bit-vec" 75 | version = "0.6.3" 76 | source = "registry+https://github.com/rust-lang/crates.io-index" 77 | checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" 78 | 79 | [[package]] 80 | name = "bitflags" 81 | version = "1.2.1" 82 | source = "registry+https://github.com/rust-lang/crates.io-index" 83 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 84 | 85 | [[package]] 86 | name = "bumpalo" 87 | version = "3.4.0" 88 | source = "registry+https://github.com/rust-lang/crates.io-index" 89 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 90 | 91 | [[package]] 92 | name = "byteorder" 93 | version = "1.4.3" 94 | source = "registry+https://github.com/rust-lang/crates.io-index" 95 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 96 | 97 | [[package]] 98 | name = "bytes" 99 | version = "1.3.0" 100 | source = "registry+https://github.com/rust-lang/crates.io-index" 101 | checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" 102 | 103 | [[package]] 104 | name = "cc" 105 | version = "1.0.66" 106 | source = "registry+https://github.com/rust-lang/crates.io-index" 107 | checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" 108 | 109 | [[package]] 110 | name = "cfg-if" 111 | version = "0.1.10" 112 | source = "registry+https://github.com/rust-lang/crates.io-index" 113 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 114 | 115 | [[package]] 116 | name = "cfg-if" 117 | version = "1.0.0" 118 | source = "registry+https://github.com/rust-lang/crates.io-index" 119 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 120 | 121 | [[package]] 122 | name = "core-foundation" 123 | version = "0.9.1" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" 126 | dependencies = [ 127 | "core-foundation-sys", 128 | "libc", 129 | ] 130 | 131 | [[package]] 132 | name = "core-foundation-sys" 133 | version = "0.8.2" 134 | source = "registry+https://github.com/rust-lang/crates.io-index" 135 | checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" 136 | 137 | [[package]] 138 | name = "crc32fast" 139 | version = "1.3.2" 140 | source = "registry+https://github.com/rust-lang/crates.io-index" 141 | checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" 142 | dependencies = [ 143 | "cfg-if 1.0.0", 144 | ] 145 | 146 | [[package]] 147 | name = "fastrand" 148 | version = "1.7.0" 149 | source = "registry+https://github.com/rust-lang/crates.io-index" 150 | checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" 151 | dependencies = [ 152 | "instant", 153 | ] 154 | 155 | [[package]] 156 | name = "flate2" 157 | version = "1.0.27" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" 160 | dependencies = [ 161 | "crc32fast", 162 | "miniz_oxide", 163 | ] 164 | 165 | [[package]] 166 | name = "fnv" 167 | version = "1.0.7" 168 | source = "registry+https://github.com/rust-lang/crates.io-index" 169 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 170 | 171 | [[package]] 172 | name = "form_urlencoded" 173 | version = "1.0.0" 174 | source = "registry+https://github.com/rust-lang/crates.io-index" 175 | checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" 176 | dependencies = [ 177 | "matches", 178 | "percent-encoding", 179 | ] 180 | 181 | [[package]] 182 | name = "getrandom" 183 | version = "0.2.2" 184 | source = "registry+https://github.com/rust-lang/crates.io-index" 185 | checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" 186 | dependencies = [ 187 | "cfg-if 1.0.0", 188 | "libc", 189 | "wasi", 190 | ] 191 | 192 | [[package]] 193 | name = "hashbrown" 194 | version = "0.12.2" 195 | source = "registry+https://github.com/rust-lang/crates.io-index" 196 | checksum = "607c8a29735385251a339424dd462993c0fed8fa09d378f259377df08c126022" 197 | 198 | [[package]] 199 | name = "heck" 200 | version = "0.3.2" 201 | source = "registry+https://github.com/rust-lang/crates.io-index" 202 | checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" 203 | dependencies = [ 204 | "unicode-segmentation", 205 | ] 206 | 207 | [[package]] 208 | name = "http" 209 | version = "0.2.8" 210 | source = "registry+https://github.com/rust-lang/crates.io-index" 211 | checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" 212 | dependencies = [ 213 | "bytes", 214 | "fnv", 215 | "itoa", 216 | ] 217 | 218 | [[package]] 219 | name = "idna" 220 | version = "0.2.0" 221 | source = "registry+https://github.com/rust-lang/crates.io-index" 222 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 223 | dependencies = [ 224 | "matches", 225 | "unicode-bidi", 226 | "unicode-normalization", 227 | ] 228 | 229 | [[package]] 230 | name = "indexmap" 231 | version = "1.9.1" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" 234 | dependencies = [ 235 | "autocfg", 236 | "hashbrown", 237 | "serde", 238 | ] 239 | 240 | [[package]] 241 | name = "instant" 242 | version = "0.1.9" 243 | source = "registry+https://github.com/rust-lang/crates.io-index" 244 | checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" 245 | dependencies = [ 246 | "cfg-if 1.0.0", 247 | ] 248 | 249 | [[package]] 250 | name = "itoa" 251 | version = "1.0.5" 252 | source = "registry+https://github.com/rust-lang/crates.io-index" 253 | checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" 254 | 255 | [[package]] 256 | name = "js-sys" 257 | version = "0.3.46" 258 | source = "registry+https://github.com/rust-lang/crates.io-index" 259 | checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" 260 | dependencies = [ 261 | "wasm-bindgen", 262 | ] 263 | 264 | [[package]] 265 | name = "lazy_static" 266 | version = "1.4.0" 267 | source = "registry+https://github.com/rust-lang/crates.io-index" 268 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 269 | 270 | [[package]] 271 | name = "libc" 272 | version = "0.2.81" 273 | source = "registry+https://github.com/rust-lang/crates.io-index" 274 | checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" 275 | 276 | [[package]] 277 | name = "libm" 278 | version = "0.2.6" 279 | source = "registry+https://github.com/rust-lang/crates.io-index" 280 | checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" 281 | 282 | [[package]] 283 | name = "linked-hash-map" 284 | version = "0.5.6" 285 | source = "registry+https://github.com/rust-lang/crates.io-index" 286 | checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" 287 | 288 | [[package]] 289 | name = "log" 290 | version = "0.4.11" 291 | source = "registry+https://github.com/rust-lang/crates.io-index" 292 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 293 | dependencies = [ 294 | "cfg-if 0.1.10", 295 | ] 296 | 297 | [[package]] 298 | name = "matches" 299 | version = "0.1.8" 300 | source = "registry+https://github.com/rust-lang/crates.io-index" 301 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 302 | 303 | [[package]] 304 | name = "miniz_oxide" 305 | version = "0.7.1" 306 | source = "registry+https://github.com/rust-lang/crates.io-index" 307 | checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" 308 | dependencies = [ 309 | "adler", 310 | ] 311 | 312 | [[package]] 313 | name = "num-traits" 314 | version = "0.2.15" 315 | source = "registry+https://github.com/rust-lang/crates.io-index" 316 | checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" 317 | dependencies = [ 318 | "autocfg", 319 | "libm", 320 | ] 321 | 322 | [[package]] 323 | name = "once_cell" 324 | version = "1.5.2" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" 327 | 328 | [[package]] 329 | name = "openapi-fuzzer" 330 | version = "0.2.0" 331 | dependencies = [ 332 | "anyhow", 333 | "arbitrary", 334 | "argh", 335 | "indexmap", 336 | "openapi_utils", 337 | "openapiv3", 338 | "proptest", 339 | "rustls", 340 | "serde", 341 | "serde_json", 342 | "serde_yaml", 343 | "ureq", 344 | "url", 345 | ] 346 | 347 | [[package]] 348 | name = "openapi_utils" 349 | version = "0.2.2" 350 | source = "registry+https://github.com/rust-lang/crates.io-index" 351 | checksum = "4424cd4810cfd406ae03018e0c3494c74ba8144ffcdad785a9bf9bc2fbb251b2" 352 | dependencies = [ 353 | "http", 354 | "indexmap", 355 | "log", 356 | "openapiv3", 357 | ] 358 | 359 | [[package]] 360 | name = "openapiv3" 361 | version = "0.5.0" 362 | source = "registry+https://github.com/rust-lang/crates.io-index" 363 | checksum = "90228d34f20d9fff3174d19b0d41e67f52711045270b540a2a2c2dc41ccb4085" 364 | dependencies = [ 365 | "indexmap", 366 | "serde", 367 | "serde_json", 368 | "serde_yaml", 369 | ] 370 | 371 | [[package]] 372 | name = "openssl-probe" 373 | version = "0.1.2" 374 | source = "registry+https://github.com/rust-lang/crates.io-index" 375 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 376 | 377 | [[package]] 378 | name = "percent-encoding" 379 | version = "2.1.0" 380 | source = "registry+https://github.com/rust-lang/crates.io-index" 381 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 382 | 383 | [[package]] 384 | name = "ppv-lite86" 385 | version = "0.2.10" 386 | source = "registry+https://github.com/rust-lang/crates.io-index" 387 | checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" 388 | 389 | [[package]] 390 | name = "proc-macro2" 391 | version = "1.0.66" 392 | source = "registry+https://github.com/rust-lang/crates.io-index" 393 | checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" 394 | dependencies = [ 395 | "unicode-ident", 396 | ] 397 | 398 | [[package]] 399 | name = "proptest" 400 | version = "1.1.0" 401 | source = "registry+https://github.com/rust-lang/crates.io-index" 402 | checksum = "29f1b898011ce9595050a68e60f90bad083ff2987a695a42357134c8381fba70" 403 | dependencies = [ 404 | "bit-set", 405 | "bitflags", 406 | "byteorder", 407 | "lazy_static", 408 | "num-traits", 409 | "quick-error 2.0.1", 410 | "rand", 411 | "rand_chacha", 412 | "rand_xorshift", 413 | "regex-syntax", 414 | "rusty-fork", 415 | "tempfile", 416 | "unarray", 417 | ] 418 | 419 | [[package]] 420 | name = "quick-error" 421 | version = "1.2.3" 422 | source = "registry+https://github.com/rust-lang/crates.io-index" 423 | checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" 424 | 425 | [[package]] 426 | name = "quick-error" 427 | version = "2.0.1" 428 | source = "registry+https://github.com/rust-lang/crates.io-index" 429 | checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3" 430 | 431 | [[package]] 432 | name = "quote" 433 | version = "1.0.33" 434 | source = "registry+https://github.com/rust-lang/crates.io-index" 435 | checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" 436 | dependencies = [ 437 | "proc-macro2", 438 | ] 439 | 440 | [[package]] 441 | name = "rand" 442 | version = "0.8.3" 443 | source = "registry+https://github.com/rust-lang/crates.io-index" 444 | checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" 445 | dependencies = [ 446 | "libc", 447 | "rand_chacha", 448 | "rand_core", 449 | ] 450 | 451 | [[package]] 452 | name = "rand_chacha" 453 | version = "0.3.0" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" 456 | dependencies = [ 457 | "ppv-lite86", 458 | "rand_core", 459 | ] 460 | 461 | [[package]] 462 | name = "rand_core" 463 | version = "0.6.2" 464 | source = "registry+https://github.com/rust-lang/crates.io-index" 465 | checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7" 466 | dependencies = [ 467 | "getrandom", 468 | ] 469 | 470 | [[package]] 471 | name = "rand_xorshift" 472 | version = "0.3.0" 473 | source = "registry+https://github.com/rust-lang/crates.io-index" 474 | checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" 475 | dependencies = [ 476 | "rand_core", 477 | ] 478 | 479 | [[package]] 480 | name = "redox_syscall" 481 | version = "0.2.13" 482 | source = "registry+https://github.com/rust-lang/crates.io-index" 483 | checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" 484 | dependencies = [ 485 | "bitflags", 486 | ] 487 | 488 | [[package]] 489 | name = "regex-syntax" 490 | version = "0.6.27" 491 | source = "registry+https://github.com/rust-lang/crates.io-index" 492 | checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" 493 | 494 | [[package]] 495 | name = "remove_dir_all" 496 | version = "0.5.3" 497 | source = "registry+https://github.com/rust-lang/crates.io-index" 498 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 499 | dependencies = [ 500 | "winapi", 501 | ] 502 | 503 | [[package]] 504 | name = "ring" 505 | version = "0.16.20" 506 | source = "registry+https://github.com/rust-lang/crates.io-index" 507 | checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" 508 | dependencies = [ 509 | "cc", 510 | "libc", 511 | "once_cell", 512 | "spin", 513 | "untrusted", 514 | "web-sys", 515 | "winapi", 516 | ] 517 | 518 | [[package]] 519 | name = "rustls" 520 | version = "0.21.7" 521 | source = "registry+https://github.com/rust-lang/crates.io-index" 522 | checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" 523 | dependencies = [ 524 | "log", 525 | "ring", 526 | "rustls-webpki 0.101.5", 527 | "sct", 528 | ] 529 | 530 | [[package]] 531 | name = "rustls-native-certs" 532 | version = "0.6.3" 533 | source = "registry+https://github.com/rust-lang/crates.io-index" 534 | checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" 535 | dependencies = [ 536 | "openssl-probe", 537 | "rustls-pemfile", 538 | "schannel", 539 | "security-framework", 540 | ] 541 | 542 | [[package]] 543 | name = "rustls-pemfile" 544 | version = "1.0.3" 545 | source = "registry+https://github.com/rust-lang/crates.io-index" 546 | checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" 547 | dependencies = [ 548 | "base64", 549 | ] 550 | 551 | [[package]] 552 | name = "rustls-webpki" 553 | version = "0.100.2" 554 | source = "registry+https://github.com/rust-lang/crates.io-index" 555 | checksum = "e98ff011474fa39949b7e5c0428f9b4937eda7da7848bbb947786b7be0b27dab" 556 | dependencies = [ 557 | "ring", 558 | "untrusted", 559 | ] 560 | 561 | [[package]] 562 | name = "rustls-webpki" 563 | version = "0.101.5" 564 | source = "registry+https://github.com/rust-lang/crates.io-index" 565 | checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" 566 | dependencies = [ 567 | "ring", 568 | "untrusted", 569 | ] 570 | 571 | [[package]] 572 | name = "rusty-fork" 573 | version = "0.3.0" 574 | source = "registry+https://github.com/rust-lang/crates.io-index" 575 | checksum = "cb3dcc6e454c328bb824492db107ab7c0ae8fcffe4ad210136ef014458c1bc4f" 576 | dependencies = [ 577 | "fnv", 578 | "quick-error 1.2.3", 579 | "tempfile", 580 | "wait-timeout", 581 | ] 582 | 583 | [[package]] 584 | name = "ryu" 585 | version = "1.0.5" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 588 | 589 | [[package]] 590 | name = "schannel" 591 | version = "0.1.19" 592 | source = "registry+https://github.com/rust-lang/crates.io-index" 593 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 594 | dependencies = [ 595 | "lazy_static", 596 | "winapi", 597 | ] 598 | 599 | [[package]] 600 | name = "sct" 601 | version = "0.7.0" 602 | source = "registry+https://github.com/rust-lang/crates.io-index" 603 | checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" 604 | dependencies = [ 605 | "ring", 606 | "untrusted", 607 | ] 608 | 609 | [[package]] 610 | name = "security-framework" 611 | version = "2.2.0" 612 | source = "registry+https://github.com/rust-lang/crates.io-index" 613 | checksum = "3670b1d2fdf6084d192bc71ead7aabe6c06aa2ea3fbd9cc3ac111fa5c2b1bd84" 614 | dependencies = [ 615 | "bitflags", 616 | "core-foundation", 617 | "core-foundation-sys", 618 | "libc", 619 | "security-framework-sys", 620 | ] 621 | 622 | [[package]] 623 | name = "security-framework-sys" 624 | version = "2.2.0" 625 | source = "registry+https://github.com/rust-lang/crates.io-index" 626 | checksum = "3676258fd3cfe2c9a0ec99ce3038798d847ce3e4bb17746373eb9f0f1ac16339" 627 | dependencies = [ 628 | "core-foundation-sys", 629 | "libc", 630 | ] 631 | 632 | [[package]] 633 | name = "serde" 634 | version = "1.0.188" 635 | source = "registry+https://github.com/rust-lang/crates.io-index" 636 | checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" 637 | dependencies = [ 638 | "serde_derive", 639 | ] 640 | 641 | [[package]] 642 | name = "serde_derive" 643 | version = "1.0.188" 644 | source = "registry+https://github.com/rust-lang/crates.io-index" 645 | checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" 646 | dependencies = [ 647 | "proc-macro2", 648 | "quote", 649 | "syn 2.0.32", 650 | ] 651 | 652 | [[package]] 653 | name = "serde_json" 654 | version = "1.0.106" 655 | source = "registry+https://github.com/rust-lang/crates.io-index" 656 | checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" 657 | dependencies = [ 658 | "itoa", 659 | "ryu", 660 | "serde", 661 | ] 662 | 663 | [[package]] 664 | name = "serde_yaml" 665 | version = "0.8.26" 666 | source = "registry+https://github.com/rust-lang/crates.io-index" 667 | checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" 668 | dependencies = [ 669 | "indexmap", 670 | "ryu", 671 | "serde", 672 | "yaml-rust", 673 | ] 674 | 675 | [[package]] 676 | name = "spin" 677 | version = "0.5.2" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" 680 | 681 | [[package]] 682 | name = "syn" 683 | version = "1.0.107" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" 686 | dependencies = [ 687 | "proc-macro2", 688 | "quote", 689 | "unicode-ident", 690 | ] 691 | 692 | [[package]] 693 | name = "syn" 694 | version = "2.0.32" 695 | source = "registry+https://github.com/rust-lang/crates.io-index" 696 | checksum = "239814284fd6f1a4ffe4ca893952cdd93c224b6a1571c9a9eadd670295c0c9e2" 697 | dependencies = [ 698 | "proc-macro2", 699 | "quote", 700 | "unicode-ident", 701 | ] 702 | 703 | [[package]] 704 | name = "tempfile" 705 | version = "3.3.0" 706 | source = "registry+https://github.com/rust-lang/crates.io-index" 707 | checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" 708 | dependencies = [ 709 | "cfg-if 1.0.0", 710 | "fastrand", 711 | "libc", 712 | "redox_syscall", 713 | "remove_dir_all", 714 | "winapi", 715 | ] 716 | 717 | [[package]] 718 | name = "tinyvec" 719 | version = "1.1.0" 720 | source = "registry+https://github.com/rust-lang/crates.io-index" 721 | checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" 722 | dependencies = [ 723 | "tinyvec_macros", 724 | ] 725 | 726 | [[package]] 727 | name = "tinyvec_macros" 728 | version = "0.1.0" 729 | source = "registry+https://github.com/rust-lang/crates.io-index" 730 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 731 | 732 | [[package]] 733 | name = "unarray" 734 | version = "0.1.4" 735 | source = "registry+https://github.com/rust-lang/crates.io-index" 736 | checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" 737 | 738 | [[package]] 739 | name = "unicode-bidi" 740 | version = "0.3.4" 741 | source = "registry+https://github.com/rust-lang/crates.io-index" 742 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 743 | dependencies = [ 744 | "matches", 745 | ] 746 | 747 | [[package]] 748 | name = "unicode-ident" 749 | version = "1.0.6" 750 | source = "registry+https://github.com/rust-lang/crates.io-index" 751 | checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" 752 | 753 | [[package]] 754 | name = "unicode-normalization" 755 | version = "0.1.16" 756 | source = "registry+https://github.com/rust-lang/crates.io-index" 757 | checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" 758 | dependencies = [ 759 | "tinyvec", 760 | ] 761 | 762 | [[package]] 763 | name = "unicode-segmentation" 764 | version = "1.7.1" 765 | source = "registry+https://github.com/rust-lang/crates.io-index" 766 | checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" 767 | 768 | [[package]] 769 | name = "untrusted" 770 | version = "0.7.1" 771 | source = "registry+https://github.com/rust-lang/crates.io-index" 772 | checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" 773 | 774 | [[package]] 775 | name = "ureq" 776 | version = "2.7.1" 777 | source = "registry+https://github.com/rust-lang/crates.io-index" 778 | checksum = "0b11c96ac7ee530603dcdf68ed1557050f374ce55a5a07193ebf8cbc9f8927e9" 779 | dependencies = [ 780 | "base64", 781 | "flate2", 782 | "log", 783 | "once_cell", 784 | "rustls", 785 | "rustls-native-certs", 786 | "rustls-webpki 0.100.2", 787 | "serde", 788 | "serde_json", 789 | "url", 790 | "webpki-roots", 791 | ] 792 | 793 | [[package]] 794 | name = "url" 795 | version = "2.2.0" 796 | source = "registry+https://github.com/rust-lang/crates.io-index" 797 | checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" 798 | dependencies = [ 799 | "form_urlencoded", 800 | "idna", 801 | "matches", 802 | "percent-encoding", 803 | "serde", 804 | ] 805 | 806 | [[package]] 807 | name = "wait-timeout" 808 | version = "0.2.0" 809 | source = "registry+https://github.com/rust-lang/crates.io-index" 810 | checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" 811 | dependencies = [ 812 | "libc", 813 | ] 814 | 815 | [[package]] 816 | name = "wasi" 817 | version = "0.10.2+wasi-snapshot-preview1" 818 | source = "registry+https://github.com/rust-lang/crates.io-index" 819 | checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" 820 | 821 | [[package]] 822 | name = "wasm-bindgen" 823 | version = "0.2.69" 824 | source = "registry+https://github.com/rust-lang/crates.io-index" 825 | checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" 826 | dependencies = [ 827 | "cfg-if 1.0.0", 828 | "wasm-bindgen-macro", 829 | ] 830 | 831 | [[package]] 832 | name = "wasm-bindgen-backend" 833 | version = "0.2.69" 834 | source = "registry+https://github.com/rust-lang/crates.io-index" 835 | checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" 836 | dependencies = [ 837 | "bumpalo", 838 | "lazy_static", 839 | "log", 840 | "proc-macro2", 841 | "quote", 842 | "syn 1.0.107", 843 | "wasm-bindgen-shared", 844 | ] 845 | 846 | [[package]] 847 | name = "wasm-bindgen-macro" 848 | version = "0.2.69" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" 851 | dependencies = [ 852 | "quote", 853 | "wasm-bindgen-macro-support", 854 | ] 855 | 856 | [[package]] 857 | name = "wasm-bindgen-macro-support" 858 | version = "0.2.69" 859 | source = "registry+https://github.com/rust-lang/crates.io-index" 860 | checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" 861 | dependencies = [ 862 | "proc-macro2", 863 | "quote", 864 | "syn 1.0.107", 865 | "wasm-bindgen-backend", 866 | "wasm-bindgen-shared", 867 | ] 868 | 869 | [[package]] 870 | name = "wasm-bindgen-shared" 871 | version = "0.2.69" 872 | source = "registry+https://github.com/rust-lang/crates.io-index" 873 | checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" 874 | 875 | [[package]] 876 | name = "web-sys" 877 | version = "0.3.46" 878 | source = "registry+https://github.com/rust-lang/crates.io-index" 879 | checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" 880 | dependencies = [ 881 | "js-sys", 882 | "wasm-bindgen", 883 | ] 884 | 885 | [[package]] 886 | name = "webpki-roots" 887 | version = "0.23.1" 888 | source = "registry+https://github.com/rust-lang/crates.io-index" 889 | checksum = "b03058f88386e5ff5310d9111d53f48b17d732b401aeb83a8d5190f2ac459338" 890 | dependencies = [ 891 | "rustls-webpki 0.100.2", 892 | ] 893 | 894 | [[package]] 895 | name = "winapi" 896 | version = "0.3.9" 897 | source = "registry+https://github.com/rust-lang/crates.io-index" 898 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 899 | dependencies = [ 900 | "winapi-i686-pc-windows-gnu", 901 | "winapi-x86_64-pc-windows-gnu", 902 | ] 903 | 904 | [[package]] 905 | name = "winapi-i686-pc-windows-gnu" 906 | version = "0.4.0" 907 | source = "registry+https://github.com/rust-lang/crates.io-index" 908 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 909 | 910 | [[package]] 911 | name = "winapi-x86_64-pc-windows-gnu" 912 | version = "0.4.0" 913 | source = "registry+https://github.com/rust-lang/crates.io-index" 914 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 915 | 916 | [[package]] 917 | name = "yaml-rust" 918 | version = "0.4.5" 919 | source = "registry+https://github.com/rust-lang/crates.io-index" 920 | checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" 921 | dependencies = [ 922 | "linked-hash-map", 923 | ] 924 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU AFFERO GENERAL PUBLIC LICENSE 2 | Version 3, 19 November 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU Affero General Public License is a free, copyleft license for 11 | software and other kinds of works, specifically designed to ensure 12 | cooperation with the community in the case of network server software. 13 | 14 | The licenses for most software and other practical works are designed 15 | to take away your freedom to share and change the works. By contrast, 16 | our General Public Licenses are intended to guarantee your freedom to 17 | share and change all versions of a program--to make sure it remains free 18 | software for all its users. 19 | 20 | When we speak of free software, we are referring to freedom, not 21 | price. Our General Public Licenses are designed to make sure that you 22 | have the freedom to distribute copies of free software (and charge for 23 | them if you wish), that you receive source code or can get it if you 24 | want it, that you can change the software or use pieces of it in new 25 | free programs, and that you know you can do these things. 26 | 27 | Developers that use our General Public Licenses protect your rights 28 | with two steps: (1) assert copyright on the software, and (2) offer 29 | you this License which gives you legal permission to copy, distribute 30 | and/or modify the software. 31 | 32 | A secondary benefit of defending all users' freedom is that 33 | improvements made in alternate versions of the program, if they 34 | receive widespread use, become available for other developers to 35 | incorporate. Many developers of free software are heartened and 36 | encouraged by the resulting cooperation. However, in the case of 37 | software used on network servers, this result may fail to come about. 38 | The GNU General Public License permits making a modified version and 39 | letting the public access it on a server without ever releasing its 40 | source code to the public. 41 | 42 | The GNU Affero General Public License is designed specifically to 43 | ensure that, in such cases, the modified source code becomes available 44 | to the community. It requires the operator of a network server to 45 | provide the source code of the modified version running there to the 46 | users of that server. Therefore, public use of a modified version, on 47 | a publicly accessible server, gives the public access to the source 48 | code of the modified version. 49 | 50 | An older license, called the Affero General Public License and 51 | published by Affero, was designed to accomplish similar goals. This is 52 | a different license, not a version of the Affero GPL, but Affero has 53 | released a new version of the Affero GPL which permits relicensing under 54 | this license. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | TERMS AND CONDITIONS 60 | 61 | 0. Definitions. 62 | 63 | "This License" refers to version 3 of the GNU Affero General Public License. 64 | 65 | "Copyright" also means copyright-like laws that apply to other kinds of 66 | works, such as semiconductor masks. 67 | 68 | "The Program" refers to any copyrightable work licensed under this 69 | License. Each licensee is addressed as "you". "Licensees" and 70 | "recipients" may be individuals or organizations. 71 | 72 | To "modify" a work means to copy from or adapt all or part of the work 73 | in a fashion requiring copyright permission, other than the making of an 74 | exact copy. The resulting work is called a "modified version" of the 75 | earlier work or a work "based on" the earlier work. 76 | 77 | A "covered work" means either the unmodified Program or a work based 78 | on the Program. 79 | 80 | To "propagate" a work means to do anything with it that, without 81 | permission, would make you directly or secondarily liable for 82 | infringement under applicable copyright law, except executing it on a 83 | computer or modifying a private copy. Propagation includes copying, 84 | distribution (with or without modification), making available to the 85 | public, and in some countries other activities as well. 86 | 87 | To "convey" a work means any kind of propagation that enables other 88 | parties to make or receive copies. Mere interaction with a user through 89 | a computer network, with no transfer of a copy, is not conveying. 90 | 91 | An interactive user interface displays "Appropriate Legal Notices" 92 | to the extent that it includes a convenient and prominently visible 93 | feature that (1) displays an appropriate copyright notice, and (2) 94 | tells the user that there is no warranty for the work (except to the 95 | extent that warranties are provided), that licensees may convey the 96 | work under this License, and how to view a copy of this License. If 97 | the interface presents a list of user commands or options, such as a 98 | menu, a prominent item in the list meets this criterion. 99 | 100 | 1. Source Code. 101 | 102 | The "source code" for a work means the preferred form of the work 103 | for making modifications to it. "Object code" means any non-source 104 | form of a work. 105 | 106 | A "Standard Interface" means an interface that either is an official 107 | standard defined by a recognized standards body, or, in the case of 108 | interfaces specified for a particular programming language, one that 109 | is widely used among developers working in that language. 110 | 111 | The "System Libraries" of an executable work include anything, other 112 | than the work as a whole, that (a) is included in the normal form of 113 | packaging a Major Component, but which is not part of that Major 114 | Component, and (b) serves only to enable use of the work with that 115 | Major Component, or to implement a Standard Interface for which an 116 | implementation is available to the public in source code form. A 117 | "Major Component", in this context, means a major essential component 118 | (kernel, window system, and so on) of the specific operating system 119 | (if any) on which the executable work runs, or a compiler used to 120 | produce the work, or an object code interpreter used to run it. 121 | 122 | The "Corresponding Source" for a work in object code form means all 123 | the source code needed to generate, install, and (for an executable 124 | work) run the object code and to modify the work, including scripts to 125 | control those activities. However, it does not include the work's 126 | System Libraries, or general-purpose tools or generally available free 127 | programs which are used unmodified in performing those activities but 128 | which are not part of the work. For example, Corresponding Source 129 | includes interface definition files associated with source files for 130 | the work, and the source code for shared libraries and dynamically 131 | linked subprograms that the work is specifically designed to require, 132 | such as by intimate data communication or control flow between those 133 | subprograms and other parts of the work. 134 | 135 | The Corresponding Source need not include anything that users 136 | can regenerate automatically from other parts of the Corresponding 137 | Source. 138 | 139 | The Corresponding Source for a work in source code form is that 140 | same work. 141 | 142 | 2. Basic Permissions. 143 | 144 | All rights granted under this License are granted for the term of 145 | copyright on the Program, and are irrevocable provided the stated 146 | conditions are met. This License explicitly affirms your unlimited 147 | permission to run the unmodified Program. The output from running a 148 | covered work is covered by this License only if the output, given its 149 | content, constitutes a covered work. This License acknowledges your 150 | rights of fair use or other equivalent, as provided by copyright law. 151 | 152 | You may make, run and propagate covered works that you do not 153 | convey, without conditions so long as your license otherwise remains 154 | in force. You may convey covered works to others for the sole purpose 155 | of having them make modifications exclusively for you, or provide you 156 | with facilities for running those works, provided that you comply with 157 | the terms of this License in conveying all material for which you do 158 | not control copyright. Those thus making or running the covered works 159 | for you must do so exclusively on your behalf, under your direction 160 | and control, on terms that prohibit them from making any copies of 161 | your copyrighted material outside their relationship with you. 162 | 163 | Conveying under any other circumstances is permitted solely under 164 | the conditions stated below. Sublicensing is not allowed; section 10 165 | makes it unnecessary. 166 | 167 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 168 | 169 | No covered work shall be deemed part of an effective technological 170 | measure under any applicable law fulfilling obligations under article 171 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 172 | similar laws prohibiting or restricting circumvention of such 173 | measures. 174 | 175 | When you convey a covered work, you waive any legal power to forbid 176 | circumvention of technological measures to the extent such circumvention 177 | is effected by exercising rights under this License with respect to 178 | the covered work, and you disclaim any intention to limit operation or 179 | modification of the work as a means of enforcing, against the work's 180 | users, your or third parties' legal rights to forbid circumvention of 181 | technological measures. 182 | 183 | 4. Conveying Verbatim Copies. 184 | 185 | You may convey verbatim copies of the Program's source code as you 186 | receive it, in any medium, provided that you conspicuously and 187 | appropriately publish on each copy an appropriate copyright notice; 188 | keep intact all notices stating that this License and any 189 | non-permissive terms added in accord with section 7 apply to the code; 190 | keep intact all notices of the absence of any warranty; and give all 191 | recipients a copy of this License along with the Program. 192 | 193 | You may charge any price or no price for each copy that you convey, 194 | and you may offer support or warranty protection for a fee. 195 | 196 | 5. Conveying Modified Source Versions. 197 | 198 | You may convey a work based on the Program, or the modifications to 199 | produce it from the Program, in the form of source code under the 200 | terms of section 4, provided that you also meet all of these conditions: 201 | 202 | a) The work must carry prominent notices stating that you modified 203 | it, and giving a relevant date. 204 | 205 | b) The work must carry prominent notices stating that it is 206 | released under this License and any conditions added under section 207 | 7. This requirement modifies the requirement in section 4 to 208 | "keep intact all notices". 209 | 210 | c) You must license the entire work, as a whole, under this 211 | License to anyone who comes into possession of a copy. This 212 | License will therefore apply, along with any applicable section 7 213 | additional terms, to the whole of the work, and all its parts, 214 | regardless of how they are packaged. This License gives no 215 | permission to license the work in any other way, but it does not 216 | invalidate such permission if you have separately received it. 217 | 218 | d) If the work has interactive user interfaces, each must display 219 | Appropriate Legal Notices; however, if the Program has interactive 220 | interfaces that do not display Appropriate Legal Notices, your 221 | work need not make them do so. 222 | 223 | A compilation of a covered work with other separate and independent 224 | works, which are not by their nature extensions of the covered work, 225 | and which are not combined with it such as to form a larger program, 226 | in or on a volume of a storage or distribution medium, is called an 227 | "aggregate" if the compilation and its resulting copyright are not 228 | used to limit the access or legal rights of the compilation's users 229 | beyond what the individual works permit. Inclusion of a covered work 230 | in an aggregate does not cause this License to apply to the other 231 | parts of the aggregate. 232 | 233 | 6. Conveying Non-Source Forms. 234 | 235 | You may convey a covered work in object code form under the terms 236 | of sections 4 and 5, provided that you also convey the 237 | machine-readable Corresponding Source under the terms of this License, 238 | in one of these ways: 239 | 240 | a) Convey the object code in, or embodied in, a physical product 241 | (including a physical distribution medium), accompanied by the 242 | Corresponding Source fixed on a durable physical medium 243 | customarily used for software interchange. 244 | 245 | b) Convey the object code in, or embodied in, a physical product 246 | (including a physical distribution medium), accompanied by a 247 | written offer, valid for at least three years and valid for as 248 | long as you offer spare parts or customer support for that product 249 | model, to give anyone who possesses the object code either (1) a 250 | copy of the Corresponding Source for all the software in the 251 | product that is covered by this License, on a durable physical 252 | medium customarily used for software interchange, for a price no 253 | more than your reasonable cost of physically performing this 254 | conveying of source, or (2) access to copy the 255 | Corresponding Source from a network server at no charge. 256 | 257 | c) Convey individual copies of the object code with a copy of the 258 | written offer to provide the Corresponding Source. This 259 | alternative is allowed only occasionally and noncommercially, and 260 | only if you received the object code with such an offer, in accord 261 | with subsection 6b. 262 | 263 | d) Convey the object code by offering access from a designated 264 | place (gratis or for a charge), and offer equivalent access to the 265 | Corresponding Source in the same way through the same place at no 266 | further charge. You need not require recipients to copy the 267 | Corresponding Source along with the object code. If the place to 268 | copy the object code is a network server, the Corresponding Source 269 | may be on a different server (operated by you or a third party) 270 | that supports equivalent copying facilities, provided you maintain 271 | clear directions next to the object code saying where to find the 272 | Corresponding Source. Regardless of what server hosts the 273 | Corresponding Source, you remain obligated to ensure that it is 274 | available for as long as needed to satisfy these requirements. 275 | 276 | e) Convey the object code using peer-to-peer transmission, provided 277 | you inform other peers where the object code and Corresponding 278 | Source of the work are being offered to the general public at no 279 | charge under subsection 6d. 280 | 281 | A separable portion of the object code, whose source code is excluded 282 | from the Corresponding Source as a System Library, need not be 283 | included in conveying the object code work. 284 | 285 | A "User Product" is either (1) a "consumer product", which means any 286 | tangible personal property which is normally used for personal, family, 287 | or household purposes, or (2) anything designed or sold for incorporation 288 | into a dwelling. In determining whether a product is a consumer product, 289 | doubtful cases shall be resolved in favor of coverage. For a particular 290 | product received by a particular user, "normally used" refers to a 291 | typical or common use of that class of product, regardless of the status 292 | of the particular user or of the way in which the particular user 293 | actually uses, or expects or is expected to use, the product. A product 294 | is a consumer product regardless of whether the product has substantial 295 | commercial, industrial or non-consumer uses, unless such uses represent 296 | the only significant mode of use of the product. 297 | 298 | "Installation Information" for a User Product means any methods, 299 | procedures, authorization keys, or other information required to install 300 | and execute modified versions of a covered work in that User Product from 301 | a modified version of its Corresponding Source. The information must 302 | suffice to ensure that the continued functioning of the modified object 303 | code is in no case prevented or interfered with solely because 304 | modification has been made. 305 | 306 | If you convey an object code work under this section in, or with, or 307 | specifically for use in, a User Product, and the conveying occurs as 308 | part of a transaction in which the right of possession and use of the 309 | User Product is transferred to the recipient in perpetuity or for a 310 | fixed term (regardless of how the transaction is characterized), the 311 | Corresponding Source conveyed under this section must be accompanied 312 | by the Installation Information. But this requirement does not apply 313 | if neither you nor any third party retains the ability to install 314 | modified object code on the User Product (for example, the work has 315 | been installed in ROM). 316 | 317 | The requirement to provide Installation Information does not include a 318 | requirement to continue to provide support service, warranty, or updates 319 | for a work that has been modified or installed by the recipient, or for 320 | the User Product in which it has been modified or installed. Access to a 321 | network may be denied when the modification itself materially and 322 | adversely affects the operation of the network or violates the rules and 323 | protocols for communication across the network. 324 | 325 | Corresponding Source conveyed, and Installation Information provided, 326 | in accord with this section must be in a format that is publicly 327 | documented (and with an implementation available to the public in 328 | source code form), and must require no special password or key for 329 | unpacking, reading or copying. 330 | 331 | 7. Additional Terms. 332 | 333 | "Additional permissions" are terms that supplement the terms of this 334 | License by making exceptions from one or more of its conditions. 335 | Additional permissions that are applicable to the entire Program shall 336 | be treated as though they were included in this License, to the extent 337 | that they are valid under applicable law. If additional permissions 338 | apply only to part of the Program, that part may be used separately 339 | under those permissions, but the entire Program remains governed by 340 | this License without regard to the additional permissions. 341 | 342 | When you convey a copy of a covered work, you may at your option 343 | remove any additional permissions from that copy, or from any part of 344 | it. (Additional permissions may be written to require their own 345 | removal in certain cases when you modify the work.) You may place 346 | additional permissions on material, added by you to a covered work, 347 | for which you have or can give appropriate copyright permission. 348 | 349 | Notwithstanding any other provision of this License, for material you 350 | add to a covered work, you may (if authorized by the copyright holders of 351 | that material) supplement the terms of this License with terms: 352 | 353 | a) Disclaiming warranty or limiting liability differently from the 354 | terms of sections 15 and 16 of this License; or 355 | 356 | b) Requiring preservation of specified reasonable legal notices or 357 | author attributions in that material or in the Appropriate Legal 358 | Notices displayed by works containing it; or 359 | 360 | c) Prohibiting misrepresentation of the origin of that material, or 361 | requiring that modified versions of such material be marked in 362 | reasonable ways as different from the original version; or 363 | 364 | d) Limiting the use for publicity purposes of names of licensors or 365 | authors of the material; or 366 | 367 | e) Declining to grant rights under trademark law for use of some 368 | trade names, trademarks, or service marks; or 369 | 370 | f) Requiring indemnification of licensors and authors of that 371 | material by anyone who conveys the material (or modified versions of 372 | it) with contractual assumptions of liability to the recipient, for 373 | any liability that these contractual assumptions directly impose on 374 | those licensors and authors. 375 | 376 | All other non-permissive additional terms are considered "further 377 | restrictions" within the meaning of section 10. If the Program as you 378 | received it, or any part of it, contains a notice stating that it is 379 | governed by this License along with a term that is a further 380 | restriction, you may remove that term. If a license document contains 381 | a further restriction but permits relicensing or conveying under this 382 | License, you may add to a covered work material governed by the terms 383 | of that license document, provided that the further restriction does 384 | not survive such relicensing or conveying. 385 | 386 | If you add terms to a covered work in accord with this section, you 387 | must place, in the relevant source files, a statement of the 388 | additional terms that apply to those files, or a notice indicating 389 | where to find the applicable terms. 390 | 391 | Additional terms, permissive or non-permissive, may be stated in the 392 | form of a separately written license, or stated as exceptions; 393 | the above requirements apply either way. 394 | 395 | 8. Termination. 396 | 397 | You may not propagate or modify a covered work except as expressly 398 | provided under this License. Any attempt otherwise to propagate or 399 | modify it is void, and will automatically terminate your rights under 400 | this License (including any patent licenses granted under the third 401 | paragraph of section 11). 402 | 403 | However, if you cease all violation of this License, then your 404 | license from a particular copyright holder is reinstated (a) 405 | provisionally, unless and until the copyright holder explicitly and 406 | finally terminates your license, and (b) permanently, if the copyright 407 | holder fails to notify you of the violation by some reasonable means 408 | prior to 60 days after the cessation. 409 | 410 | Moreover, your license from a particular copyright holder is 411 | reinstated permanently if the copyright holder notifies you of the 412 | violation by some reasonable means, this is the first time you have 413 | received notice of violation of this License (for any work) from that 414 | copyright holder, and you cure the violation prior to 30 days after 415 | your receipt of the notice. 416 | 417 | Termination of your rights under this section does not terminate the 418 | licenses of parties who have received copies or rights from you under 419 | this License. If your rights have been terminated and not permanently 420 | reinstated, you do not qualify to receive new licenses for the same 421 | material under section 10. 422 | 423 | 9. Acceptance Not Required for Having Copies. 424 | 425 | You are not required to accept this License in order to receive or 426 | run a copy of the Program. Ancillary propagation of a covered work 427 | occurring solely as a consequence of using peer-to-peer transmission 428 | to receive a copy likewise does not require acceptance. However, 429 | nothing other than this License grants you permission to propagate or 430 | modify any covered work. These actions infringe copyright if you do 431 | not accept this License. Therefore, by modifying or propagating a 432 | covered work, you indicate your acceptance of this License to do so. 433 | 434 | 10. Automatic Licensing of Downstream Recipients. 435 | 436 | Each time you convey a covered work, the recipient automatically 437 | receives a license from the original licensors, to run, modify and 438 | propagate that work, subject to this License. You are not responsible 439 | for enforcing compliance by third parties with this License. 440 | 441 | An "entity transaction" is a transaction transferring control of an 442 | organization, or substantially all assets of one, or subdividing an 443 | organization, or merging organizations. If propagation of a covered 444 | work results from an entity transaction, each party to that 445 | transaction who receives a copy of the work also receives whatever 446 | licenses to the work the party's predecessor in interest had or could 447 | give under the previous paragraph, plus a right to possession of the 448 | Corresponding Source of the work from the predecessor in interest, if 449 | the predecessor has it or can get it with reasonable efforts. 450 | 451 | You may not impose any further restrictions on the exercise of the 452 | rights granted or affirmed under this License. For example, you may 453 | not impose a license fee, royalty, or other charge for exercise of 454 | rights granted under this License, and you may not initiate litigation 455 | (including a cross-claim or counterclaim in a lawsuit) alleging that 456 | any patent claim is infringed by making, using, selling, offering for 457 | sale, or importing the Program or any portion of it. 458 | 459 | 11. Patents. 460 | 461 | A "contributor" is a copyright holder who authorizes use under this 462 | License of the Program or a work on which the Program is based. The 463 | work thus licensed is called the contributor's "contributor version". 464 | 465 | A contributor's "essential patent claims" are all patent claims 466 | owned or controlled by the contributor, whether already acquired or 467 | hereafter acquired, that would be infringed by some manner, permitted 468 | by this License, of making, using, or selling its contributor version, 469 | but do not include claims that would be infringed only as a 470 | consequence of further modification of the contributor version. For 471 | purposes of this definition, "control" includes the right to grant 472 | patent sublicenses in a manner consistent with the requirements of 473 | this License. 474 | 475 | Each contributor grants you a non-exclusive, worldwide, royalty-free 476 | patent license under the contributor's essential patent claims, to 477 | make, use, sell, offer for sale, import and otherwise run, modify and 478 | propagate the contents of its contributor version. 479 | 480 | In the following three paragraphs, a "patent license" is any express 481 | agreement or commitment, however denominated, not to enforce a patent 482 | (such as an express permission to practice a patent or covenant not to 483 | sue for patent infringement). To "grant" such a patent license to a 484 | party means to make such an agreement or commitment not to enforce a 485 | patent against the party. 486 | 487 | If you convey a covered work, knowingly relying on a patent license, 488 | and the Corresponding Source of the work is not available for anyone 489 | to copy, free of charge and under the terms of this License, through a 490 | publicly available network server or other readily accessible means, 491 | then you must either (1) cause the Corresponding Source to be so 492 | available, or (2) arrange to deprive yourself of the benefit of the 493 | patent license for this particular work, or (3) arrange, in a manner 494 | consistent with the requirements of this License, to extend the patent 495 | license to downstream recipients. "Knowingly relying" means you have 496 | actual knowledge that, but for the patent license, your conveying the 497 | covered work in a country, or your recipient's use of the covered work 498 | in a country, would infringe one or more identifiable patents in that 499 | country that you have reason to believe are valid. 500 | 501 | If, pursuant to or in connection with a single transaction or 502 | arrangement, you convey, or propagate by procuring conveyance of, a 503 | covered work, and grant a patent license to some of the parties 504 | receiving the covered work authorizing them to use, propagate, modify 505 | or convey a specific copy of the covered work, then the patent license 506 | you grant is automatically extended to all recipients of the covered 507 | work and works based on it. 508 | 509 | A patent license is "discriminatory" if it does not include within 510 | the scope of its coverage, prohibits the exercise of, or is 511 | conditioned on the non-exercise of one or more of the rights that are 512 | specifically granted under this License. You may not convey a covered 513 | work if you are a party to an arrangement with a third party that is 514 | in the business of distributing software, under which you make payment 515 | to the third party based on the extent of your activity of conveying 516 | the work, and under which the third party grants, to any of the 517 | parties who would receive the covered work from you, a discriminatory 518 | patent license (a) in connection with copies of the covered work 519 | conveyed by you (or copies made from those copies), or (b) primarily 520 | for and in connection with specific products or compilations that 521 | contain the covered work, unless you entered into that arrangement, 522 | or that patent license was granted, prior to 28 March 2007. 523 | 524 | Nothing in this License shall be construed as excluding or limiting 525 | any implied license or other defenses to infringement that may 526 | otherwise be available to you under applicable patent law. 527 | 528 | 12. No Surrender of Others' Freedom. 529 | 530 | If conditions are imposed on you (whether by court order, agreement or 531 | otherwise) that contradict the conditions of this License, they do not 532 | excuse you from the conditions of this License. If you cannot convey a 533 | covered work so as to satisfy simultaneously your obligations under this 534 | License and any other pertinent obligations, then as a consequence you may 535 | not convey it at all. For example, if you agree to terms that obligate you 536 | to collect a royalty for further conveying from those to whom you convey 537 | the Program, the only way you could satisfy both those terms and this 538 | License would be to refrain entirely from conveying the Program. 539 | 540 | 13. Remote Network Interaction; Use with the GNU General Public License. 541 | 542 | Notwithstanding any other provision of this License, if you modify the 543 | Program, your modified version must prominently offer all users 544 | interacting with it remotely through a computer network (if your version 545 | supports such interaction) an opportunity to receive the Corresponding 546 | Source of your version by providing access to the Corresponding Source 547 | from a network server at no charge, through some standard or customary 548 | means of facilitating copying of software. This Corresponding Source 549 | shall include the Corresponding Source for any work covered by version 3 550 | of the GNU General Public License that is incorporated pursuant to the 551 | following paragraph. 552 | 553 | Notwithstanding any other provision of this License, you have 554 | permission to link or combine any covered work with a work licensed 555 | under version 3 of the GNU General Public License into a single 556 | combined work, and to convey the resulting work. The terms of this 557 | License will continue to apply to the part which is the covered work, 558 | but the work with which it is combined will remain governed by version 559 | 3 of the GNU General Public License. 560 | 561 | 14. Revised Versions of this License. 562 | 563 | The Free Software Foundation may publish revised and/or new versions of 564 | the GNU Affero General Public License from time to time. Such new versions 565 | will be similar in spirit to the present version, but may differ in detail to 566 | address new problems or concerns. 567 | 568 | Each version is given a distinguishing version number. If the 569 | Program specifies that a certain numbered version of the GNU Affero General 570 | Public License "or any later version" applies to it, you have the 571 | option of following the terms and conditions either of that numbered 572 | version or of any later version published by the Free Software 573 | Foundation. If the Program does not specify a version number of the 574 | GNU Affero General Public License, you may choose any version ever published 575 | by the Free Software Foundation. 576 | 577 | If the Program specifies that a proxy can decide which future 578 | versions of the GNU Affero General Public License can be used, that proxy's 579 | public statement of acceptance of a version permanently authorizes you 580 | to choose that version for the Program. 581 | 582 | Later license versions may give you additional or different 583 | permissions. However, no additional obligations are imposed on any 584 | author or copyright holder as a result of your choosing to follow a 585 | later version. 586 | 587 | 15. Disclaimer of Warranty. 588 | 589 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 590 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 591 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 592 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 593 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 594 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 595 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 596 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 597 | 598 | 16. Limitation of Liability. 599 | 600 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 601 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 602 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 603 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 604 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 605 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 606 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 607 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 608 | SUCH DAMAGES. 609 | 610 | 17. Interpretation of Sections 15 and 16. 611 | 612 | If the disclaimer of warranty and limitation of liability provided 613 | above cannot be given local legal effect according to their terms, 614 | reviewing courts shall apply local law that most closely approximates 615 | an absolute waiver of all civil liability in connection with the 616 | Program, unless a warranty or assumption of liability accompanies a 617 | copy of the Program in return for a fee. 618 | 619 | END OF TERMS AND CONDITIONS 620 | 621 | How to Apply These Terms to Your New Programs 622 | 623 | If you develop a new program, and you want it to be of the greatest 624 | possible use to the public, the best way to achieve this is to make it 625 | free software which everyone can redistribute and change under these terms. 626 | 627 | To do so, attach the following notices to the program. It is safest 628 | to attach them to the start of each source file to most effectively 629 | state the exclusion of warranty; and each file should have at least 630 | the "copyright" line and a pointer to where the full notice is found. 631 | 632 | 633 | Copyright (C) 634 | 635 | This program is free software: you can redistribute it and/or modify 636 | it under the terms of the GNU Affero General Public License as published 637 | by the Free Software Foundation, either version 3 of the License, or 638 | (at your option) any later version. 639 | 640 | This program is distributed in the hope that it will be useful, 641 | but WITHOUT ANY WARRANTY; without even the implied warranty of 642 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 643 | GNU Affero General Public License for more details. 644 | 645 | You should have received a copy of the GNU Affero General Public License 646 | along with this program. If not, see . 647 | 648 | Also add information on how to contact you by electronic and paper mail. 649 | 650 | If your software can interact with users remotely through a computer 651 | network, you should also make sure that it provides a way for users to 652 | get its source. For example, if your program is a web application, its 653 | interface could display a "Source" link that leads users to an archive 654 | of the code. There are many ways you could offer source, and different 655 | solutions will be better for different programs; see section 13 for the 656 | specific requirements. 657 | 658 | You should also get your employer (if you work as a programmer) or school, 659 | if any, to sign a "copyright disclaimer" for the program, if necessary. 660 | For more information on this, and how to apply and follow the GNU AGPL, see 661 | . 662 | --------------------------------------------------------------------------------