From 7f8fd4673d95a71bf2f34abd2411c9b450a22e89 Mon Sep 17 00:00:00 2001 From: Zane Wolfgang Pickett Date: Tue, 22 Feb 2022 14:04:32 -0500 Subject: [PATCH 1/2] Expose proxy settings for Ruby Faraday --- .../api_client_faraday_partial.mustache | 16 ++++++++-------- .../configuration_tls_faraday_partial.mustache | 4 ++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache index a32b6ab6a8a2..4eed519e144a 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/api_client_faraday_partial.mustache @@ -12,6 +12,7 @@ } connection = Faraday.new(:url => config.base_url, :ssl => ssl_options) do |conn| + conn.proxy = config.proxy if config.proxy conn.request(:basic_auth, config.username, config.password) @config.configure_middleware(conn) if opts[:header_params]["Content-Type"] == "multipart/form-data" @@ -62,7 +63,7 @@ # @option opts [Hash] :query_params Query parameters # @option opts [Hash] :form_params Query parameters # @option opts [Object] :body HTTP body (JSON/XML) - # @return [Typhoeus::Request] A Typhoeus Request + # @return [Faraday::Request] A Faraday Request def build_request(http_method, path, request, opts = {}) url = build_request_url(path, opts) http_method = http_method.to_sym.downcase @@ -73,12 +74,6 @@ update_params_for_auth! header_params, query_params, opts[:auth_names] - req_opts = { - :params_encoding => @config.params_encoding, - :timeout => @config.timeout, - :verbose => @config.debugging - } - if [:post, :patch, :put, :delete].include?(http_method) req_body = build_request_body(header_params, form_params, opts[:body]) if @config.debugging @@ -87,7 +82,12 @@ end request.headers = header_params request.body = req_body - request.options = OpenStruct.new(req_opts) + + # Overload default options only if provided + request.options.params_encoding = @config.params_encoding if @config.params_encoding + request.options.timeout = @config.timeout if @config.timeout + request.options.verbose = @config.debugging if @config.debugging + request.url url request.params = query_params download_file(request) if opts[:return_type] == 'File' diff --git a/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache index e5f4085cda24..598186a7f930 100644 --- a/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache +++ b/modules/openapi-generator/src/main/resources/ruby-client/configuration_tls_faraday_partial.mustache @@ -27,3 +27,7 @@ ### TLS/SSL setting # Client private key file (for client certificate) attr_accessor :ssl_client_key + + ### Proxy setting + # HTTP Proxy settings + attr_accessor :proxy From 9004182e84acad8dbab0b7113e022668b20937e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 12:03:40 +0000 Subject: [PATCH 2/2] Bump actions/cache from 2.1.7 to 3.3.2 Bumps [actions/cache](https://github.com/actions/cache) from 2.1.7 to 3.3.2. - [Release notes](https://github.com/actions/cache/releases) - [Changelog](https://github.com/actions/cache/blob/main/RELEASES.md) - [Commits](https://github.com/actions/cache/compare/v2.1.7...v3.3.2) --- updated-dependencies: - dependency-name: actions/cache dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/check-supported-versions.yaml | 4 ++-- .github/workflows/gradle-test.yaml | 4 ++-- .github/workflows/openapi-generator.yaml | 8 ++++---- .github/workflows/samples-dart.yaml | 8 ++++---- .github/workflows/samples-groovy.yaml | 2 +- .github/workflows/samples-java-client-jdk11.yaml | 2 +- .github/workflows/samples-java-play-framework.yaml | 2 +- .github/workflows/samples-jaxrs.yaml | 2 +- .github/workflows/samples-kotlin-client.yaml | 2 +- .github/workflows/samples-kotlin-server.yaml | 2 +- .github/workflows/samples-scala.yaml | 2 +- .github/workflows/samples-spring.yaml | 2 +- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/.github/workflows/check-supported-versions.yaml b/.github/workflows/check-supported-versions.yaml index 78aba7433a11..6fb123fe4f7c 100644 --- a/.github/workflows/check-supported-versions.yaml +++ b/.github/workflows/check-supported-versions.yaml @@ -29,14 +29,14 @@ jobs: distribution: 'temurin' java-version: ${{ matrix.java }} - - uses: actions/cache@v2.1.7 + - uses: actions/cache@v3.3.2 with: path: ~/.m2/repository key: ${{ runner.os }}-maven-${{ hashFiles('pom.xml', 'modules/**/pom.xml') }} restore-keys: | ${{ runner.os }}-maven- - - uses: actions/cache@v2.1.7 + - uses: actions/cache@v3.3.2 with: path: | ~/.gradle/caches diff --git a/.github/workflows/gradle-test.yaml b/.github/workflows/gradle-test.yaml index c6f6f495ab17..e629a203eee1 100644 --- a/.github/workflows/gradle-test.yaml +++ b/.github/workflows/gradle-test.yaml @@ -40,14 +40,14 @@ jobs: java-version: 11 # Cache Gradle Dependencies - name: Setup Gradle Dependencies Cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 with: path: ~/.gradle/caches key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts') }} # Cache Gradle Wrapper - name: Setup Gradle Wrapper Cache - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 with: path: ~/.gradle/wrapper key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }} diff --git a/.github/workflows/openapi-generator.yaml b/.github/workflows/openapi-generator.yaml index 56958aa515b1..da3f71636fe4 100644 --- a/.github/workflows/openapi-generator.yaml +++ b/.github/workflows/openapi-generator.yaml @@ -22,7 +22,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: cache-maven-repository with: @@ -58,7 +58,7 @@ jobs: java-version: 8 distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: cache-maven-repository with: @@ -167,7 +167,7 @@ jobs: java-version: 11 distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: cache-maven-repository with: @@ -200,7 +200,7 @@ jobs: java-version: 11 distribution: 'temurin' - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: cache-maven-repository with: diff --git a/.github/workflows/samples-dart.yaml b/.github/workflows/samples-dart.yaml index 5efe3b6b686f..ac4f78fdf045 100644 --- a/.github/workflows/samples-dart.yaml +++ b/.github/workflows/samples-dart.yaml @@ -23,7 +23,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: @@ -32,7 +32,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: pub-cache with: @@ -56,7 +56,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: @@ -65,7 +65,7 @@ jobs: ~/.gradle key: ${{ runner.os }}-${{ github.job }}-${{ env.cache-name }}-${{ hashFiles('**/pom.xml') }} - name: Cache test dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: pub-cache with: diff --git a/.github/workflows/samples-groovy.yaml b/.github/workflows/samples-groovy.yaml index 06fe5cc117f7..379e9ae46cf7 100644 --- a/.github/workflows/samples-groovy.yaml +++ b/.github/workflows/samples-groovy.yaml @@ -27,7 +27,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-java-client-jdk11.yaml b/.github/workflows/samples-java-client-jdk11.yaml index 7907118eb48c..15dd7acc7fde 100644 --- a/.github/workflows/samples-java-client-jdk11.yaml +++ b/.github/workflows/samples-java-client-jdk11.yaml @@ -44,7 +44,7 @@ jobs: distribution: 'temurin' java-version: 11 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-java-play-framework.yaml b/.github/workflows/samples-java-play-framework.yaml index cd4f4ec9c26a..940fdf6713f4 100644 --- a/.github/workflows/samples-java-play-framework.yaml +++ b/.github/workflows/samples-java-play-framework.yaml @@ -35,7 +35,7 @@ jobs: distribution: 'temurin' java-version: 11 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-jaxrs.yaml b/.github/workflows/samples-jaxrs.yaml index 1000251d19b5..4be88e38e1a1 100644 --- a/.github/workflows/samples-jaxrs.yaml +++ b/.github/workflows/samples-jaxrs.yaml @@ -47,7 +47,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-kotlin-client.yaml b/.github/workflows/samples-kotlin-client.yaml index 0c6199846320..94879e6f1e4f 100644 --- a/.github/workflows/samples-kotlin-client.yaml +++ b/.github/workflows/samples-kotlin-client.yaml @@ -46,7 +46,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-kotlin-server.yaml b/.github/workflows/samples-kotlin-server.yaml index bccd2212ad2f..789a844b9dcb 100644 --- a/.github/workflows/samples-kotlin-server.yaml +++ b/.github/workflows/samples-kotlin-server.yaml @@ -36,7 +36,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-scala.yaml b/.github/workflows/samples-scala.yaml index ca908a8e8427..2aeca038a5fc 100644 --- a/.github/workflows/samples-scala.yaml +++ b/.github/workflows/samples-scala.yaml @@ -32,7 +32,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: diff --git a/.github/workflows/samples-spring.yaml b/.github/workflows/samples-spring.yaml index 328052970b31..a253f35a97c0 100644 --- a/.github/workflows/samples-spring.yaml +++ b/.github/workflows/samples-spring.yaml @@ -45,7 +45,7 @@ jobs: distribution: 'temurin' java-version: 8 - name: Cache maven dependencies - uses: actions/cache@v2.1.7 + uses: actions/cache@v3.3.2 env: cache-name: maven-repository with: