Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
ac937c1
feat(api): add per endpoint security
stainless-app[bot] Jan 26, 2026
a021ffb
chore(internal): codegen related update
stainless-app[bot] Jan 26, 2026
2ee41c8
fix(tests): skip broken date validation test
stainless-app[bot] Jan 26, 2026
8022436
fix(docs): fix mcp installation instructions for remote servers
stainless-app[bot] Jan 28, 2026
66e8f66
fix(client): always add content-length to post body, even when empty
stainless-app[bot] Feb 2, 2026
57bc88c
chore(docs): remove www prefix
stainless-app[bot] Feb 4, 2026
7bc3e65
fix(client): loosen json header parsing
stainless-app[bot] Feb 6, 2026
47876a8
chore: update mock server docs
stainless-app[bot] Feb 19, 2026
86ece75
fix: properly mock time in ruby ci tests
stainless-app[bot] Feb 26, 2026
826feaa
fix(api): remove invalid transform config
stainless-app[bot] Mar 10, 2026
04d90f0
feat(api): api update
stainless-app[bot] Mar 10, 2026
796b4db
chore(internal): codegen related update
stainless-app[bot] Mar 10, 2026
1229fe8
chore(ci): skip uploading artifacts on stainless-internal branches
stainless-app[bot] Mar 10, 2026
f4ad88e
feat(client): add webhook support
stainless-app[bot] Mar 11, 2026
c0b42bc
chore(internal): tweak CI branches
stainless-app[bot] Mar 16, 2026
da06231
codegen metadata
stainless-app[bot] Mar 17, 2026
e294a79
refactor(tests): switch from prism to steady
stainless-app[bot] Mar 19, 2026
93617aa
chore(tests): bump steady to v0.19.4
stainless-app[bot] Mar 20, 2026
424035c
chore(tests): bump steady to v0.19.5
stainless-app[bot] Mar 20, 2026
a315475
chore(internal): update gitignore
stainless-app[bot] Mar 23, 2026
b832805
chore(tests): bump steady to v0.19.6
stainless-app[bot] Mar 23, 2026
b8e66d9
chore(ci): skip lint on metadata-only changes
stainless-app[bot] Mar 24, 2026
fe2f5fb
chore(tests): bump steady to v0.19.7
stainless-app[bot] Mar 24, 2026
47c53f4
codegen metadata
stainless-app[bot] Mar 24, 2026
8ff38e4
feat(api): api update
stainless-app[bot] Mar 25, 2026
76c688f
fix(internal): correct multipart form field name encoding
stainless-app[bot] Mar 26, 2026
919a302
codegen metadata
stainless-app[bot] Mar 27, 2026
f892be4
chore(ci): support opting out of skipping builds on metadata-only com…
stainless-app[bot] Mar 27, 2026
6fb5f11
chore(tests): bump steady to v0.20.1
stainless-app[bot] Mar 31, 2026
a37acc5
chore(tests): bump steady to v0.20.2
stainless-app[bot] Mar 31, 2026
09ceda2
fix: variable name typo
stainless-app[bot] Mar 31, 2026
0a99d63
fix: align path encoding with RFC 3986 section 3.3
stainless-app[bot] Mar 31, 2026
35975e2
release: 0.1.0-alpha.43
stainless-app[bot] Mar 31, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 46 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,58 @@
name: CI
on:
push:
branches-ignore:
- 'generated'
- 'codegen/**'
- 'integrated/**'
- 'stl-preview-head/**'
- 'stl-preview-base/**'
branches:
- '**'
- '!integrated/**'
- '!stl-preview-head/**'
- '!stl-preview-base/**'
- '!generated'
- '!codegen/**'
- 'codegen/stl/**'
pull_request:
branches-ignore:
- 'stl-preview-head/**'
- 'stl-preview-base/**'

jobs:
build:
timeout-minutes: 10
name: build
permissions:
contents: read
id-token: write
runs-on: ${{ github.repository == 'stainless-sdks/finch-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
if: |-
github.repository == 'stainless-sdks/finch-ruby' &&
(github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata')
steps:
- uses: actions/checkout@v6
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
- run: |-
bundle install

- name: Get GitHub OIDC Token
if: |-
github.repository == 'stainless-sdks/finch-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
id: github-oidc
uses: actions/github-script@v8
with:
script: core.setOutput('github_token', await core.getIDToken());

- name: Build and upload gem artifacts
if: |-
github.repository == 'stainless-sdks/finch-ruby' &&
!startsWith(github.ref, 'refs/heads/stl/')
env:
URL: https://pkg.stainless.com/s
AUTH: ${{ steps.github-oidc.outputs.github_token }}
SHA: ${{ github.sha }}
PACKAGE_NAME: finch_api
run: ./scripts/utils/upload-artifact.sh
lint:
timeout-minutes: 10
name: lint
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.idea/
.ignore
.prism.log
.stdy.log
.ruby-lsp/
.yardoc/
bin/tapioca
Expand Down
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.42"
".": "0.1.0-alpha.43"
}
6 changes: 3 additions & 3 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 46
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-46f433f34d440aa1dfcc48cc8d822c598571b68be2f723ec99e1b4fba6c13b1e.yml
openapi_spec_hash: 5b5cd728776723ac773900f7e8a32c05
config_hash: 0892e2e0eeb0343a022afa62e9080dd1
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-63947213d9359808abc05e4c3cb53389325ca23c58d06bf293626f7d5d4fc2b8.yml
openapi_spec_hash: 50e4669590de9a411915a612615017d0
config_hash: d21a244fc073152c8dbecb8ece970209
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,53 @@
# Changelog

## 0.1.0-alpha.43 (2026-03-31)

Full Changelog: [v0.1.0-alpha.42...v0.1.0-alpha.43](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.42...v0.1.0-alpha.43)

### Features

* **api:** add per endpoint security ([ac937c1](https://github.com/Finch-API/finch-api-ruby/commit/ac937c138291704137a33d18cea1571d2e6f96ca))
* **api:** api update ([8ff38e4](https://github.com/Finch-API/finch-api-ruby/commit/8ff38e4aeb774f2ec8f5be0692c787652a72b88f))
* **api:** api update ([04d90f0](https://github.com/Finch-API/finch-api-ruby/commit/04d90f03077ba6b6459e3a1ecbb41baffd1e9eb5))
* **client:** add webhook support ([f4ad88e](https://github.com/Finch-API/finch-api-ruby/commit/f4ad88e63dcec2d9c6f9b64e9f10aa01a34c2af4))


### Bug Fixes

* align path encoding with RFC 3986 section 3.3 ([0a99d63](https://github.com/Finch-API/finch-api-ruby/commit/0a99d63c11aa9516a7cac12937d35972c9638f32))
* **api:** remove invalid transform config ([826feaa](https://github.com/Finch-API/finch-api-ruby/commit/826feaab2ca5d0afd202b196f5da0910c029a591))
* **client:** always add content-length to post body, even when empty ([66e8f66](https://github.com/Finch-API/finch-api-ruby/commit/66e8f668ba49f9959bd0067d4161d972ebad46ee))
* **client:** loosen json header parsing ([7bc3e65](https://github.com/Finch-API/finch-api-ruby/commit/7bc3e6509545d52948558cc20180865f09e946dc))
* **docs:** fix mcp installation instructions for remote servers ([8022436](https://github.com/Finch-API/finch-api-ruby/commit/8022436ca504321dffdb8eedabc0c9ee82e0bf45))
* **internal:** correct multipart form field name encoding ([76c688f](https://github.com/Finch-API/finch-api-ruby/commit/76c688f93a7a6bf6827baa4b1b06ad715826c491))
* properly mock time in ruby ci tests ([86ece75](https://github.com/Finch-API/finch-api-ruby/commit/86ece75b5fefd736c827c70dc7b6140ec67fdf35))
* **tests:** skip broken date validation test ([2ee41c8](https://github.com/Finch-API/finch-api-ruby/commit/2ee41c81ef9707aa7180723a283789a5bbaa041d))
* variable name typo ([09ceda2](https://github.com/Finch-API/finch-api-ruby/commit/09ceda237d92712263d0942f1deb8654afc18071))


### Chores

* **ci:** skip lint on metadata-only changes ([b8e66d9](https://github.com/Finch-API/finch-api-ruby/commit/b8e66d9232c428b9c4104bf5c6ce6673690afa2a))
* **ci:** skip uploading artifacts on stainless-internal branches ([1229fe8](https://github.com/Finch-API/finch-api-ruby/commit/1229fe85090c9c58caeb17b10434a8923fe2dcb2))
* **ci:** support opting out of skipping builds on metadata-only commits ([f892be4](https://github.com/Finch-API/finch-api-ruby/commit/f892be499c5676f466ac47676d4106bb67f52f77))
* **docs:** remove www prefix ([57bc88c](https://github.com/Finch-API/finch-api-ruby/commit/57bc88cdd60bfec535752170ffeeebe157a0bfce))
* **internal:** codegen related update ([796b4db](https://github.com/Finch-API/finch-api-ruby/commit/796b4dba769b768e65dcff3921257f098d6ff9df))
* **internal:** codegen related update ([a021ffb](https://github.com/Finch-API/finch-api-ruby/commit/a021ffb4eec64de459cb22c27b4c7c4592003d21))
* **internal:** tweak CI branches ([c0b42bc](https://github.com/Finch-API/finch-api-ruby/commit/c0b42bcd72ff06cf71fec9a98856c12043b5cfe2))
* **internal:** update gitignore ([a315475](https://github.com/Finch-API/finch-api-ruby/commit/a3154752a39a30ad3cb8aac78b2d473c3bb86dcf))
* **tests:** bump steady to v0.19.4 ([93617aa](https://github.com/Finch-API/finch-api-ruby/commit/93617aad24e3c174e12dfdf2de4bad5cce0aeb2f))
* **tests:** bump steady to v0.19.5 ([424035c](https://github.com/Finch-API/finch-api-ruby/commit/424035c08a1d4c56c3b1118cd1071bc1cbaad28a))
* **tests:** bump steady to v0.19.6 ([b832805](https://github.com/Finch-API/finch-api-ruby/commit/b8328058d1e51765ee48832897ebf00984272323))
* **tests:** bump steady to v0.19.7 ([fe2f5fb](https://github.com/Finch-API/finch-api-ruby/commit/fe2f5fb484c9684d6586106172cd984f17e914c1))
* **tests:** bump steady to v0.20.1 ([6fb5f11](https://github.com/Finch-API/finch-api-ruby/commit/6fb5f11fe816634a6ea3267f5c10831b2f5a1058))
* **tests:** bump steady to v0.20.2 ([a37acc5](https://github.com/Finch-API/finch-api-ruby/commit/a37acc5ccb90a944a7bb903befbf8a5faa60a32e))
* update mock server docs ([47876a8](https://github.com/Finch-API/finch-api-ruby/commit/47876a8821367b8d730229c8bf401bc92907d4f0))


### Refactors

* **tests:** switch from prism to steady ([e294a79](https://github.com/Finch-API/finch-api-ruby/commit/e294a795e94df460394978881960bbc067181a7e))

## 0.1.0-alpha.42 (2026-01-16)

Full Changelog: [v0.1.0-alpha.41...v0.1.0-alpha.42](https://github.com/Finch-API/finch-api-ruby/compare/v0.1.0-alpha.41...v0.1.0-alpha.42)
Expand Down
10 changes: 5 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ If you’d like to use the repository from source, you can either install from g
To install via git in your `Gemfile`:

```ruby
gem "finch-api", git: "https://www.github.com/Finch-API/finch-api-ruby"
gem "finch-api", git: "https://github.com/Finch-API/finch-api-ruby"
```

Alternatively, reference local copy of the repo:

```bash
$ git clone -- 'https://www.github.com/Finch-API/finch-api-ruby' '<path-to-repo>'
$ git clone -- 'https://github.com/Finch-API/finch-api-ruby' '<path-to-repo>'
```

```ruby
Expand All @@ -66,10 +66,10 @@ $ bundle exec rake

## Running tests

Most tests require you to [set up a mock server](https://github.com/stoplightio/prism) against the OpenAPI spec to run the tests.
Most tests require you to [set up a mock server](https://github.com/dgellow/steady) against the OpenAPI spec to run the tests.

```bash
$ npx prism mock path/to/your/openapi.yml
```sh
$ ./scripts/mock
```

```bash
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ GIT
PATH
remote: .
specs:
finch-api (0.1.0.pre.alpha.42)
finch-api (0.1.0.pre.alpha.43)
cgi
connection_pool

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ It is generated with [Stainless](https://www.stainless.com/).

Use the Finch MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl19)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%7D)
[![Add to Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en-US/install-mcp?name=%40tryfinch%2Ffinch-api-mcp&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsIkB0cnlmaW5jaC9maW5jaC1hcGktbWNwIl0sImVudiI6eyJGSU5DSF9BQ0NFU1NfVE9LRU4iOiJNeSBBY2Nlc3MgVG9rZW4iLCJGSU5DSF9DTElFTlRfSUQiOiI0YWIxNWU1MS0xMWFkLTQ5ZjQtYWNhZS1mMzQzYjc3OTQzNzUiLCJGSU5DSF9DTElFTlRfU0VDUkVUIjoiTXkgQ2xpZW50IFNlY3JldCIsIkZJTkNIX1dFQkhPT0tfU0VDUkVUIjoiTXkgV2ViaG9vayBTZWNyZXQifX0)
[![Install in VS Code](https://img.shields.io/badge/_-Add_to_VS_Code-blue?style=for-the-badge&logo=data:image/svg%2bxml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHZpZXdCb3g9IjAgMCA0MCA0MCI+PHBhdGggZmlsbD0iI0VFRSIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMzAuMjM1IDM5Ljg4NGEyLjQ5MSAyLjQ5MSAwIDAgMS0xLjc4MS0uNzNMMTIuNyAyNC43OGwtMy40NiAyLjYyNC0zLjQwNiAyLjU4MmExLjY2NSAxLjY2NSAwIDAgMS0xLjA4Mi4zMzggMS42NjQgMS42NjQgMCAwIDEtMS4wNDYtLjQzMWwtMi4yLTJhMS42NjYgMS42NjYgMCAwIDEgMC0yLjQ2M0w3LjQ1OCAyMCA0LjY3IDE3LjQ1MyAxLjUwNyAxNC41N2ExLjY2NSAxLjY2NSAwIDAgMSAwLTIuNDYzbDIuMi0yYTEuNjY1IDEuNjY1IDAgMCAxIDIuMTMtLjA5N2w2Ljg2MyA1LjIwOUwyOC40NTIuODQ0YTIuNDg4IDIuNDg4IDAgMCAxIDEuODQxLS43MjljLjM1MS4wMDkuNjk5LjA5MSAxLjAxOS4yNDVsOC4yMzYgMy45NjFhMi41IDIuNSAwIDAgMSAxLjQxNSAyLjI1M3YuMDk5LS4wNDVWMzMuMzd2LS4wNDUuMDk1YTIuNTAxIDIuNTAxIDAgMCAxLTEuNDE2IDIuMjU3bC04LjIzNSAzLjk2MWEyLjQ5MiAyLjQ5MiAwIDAgMS0xLjA3Ny4yNDZabS43MTYtMjguOTQ3LTExLjk0OCA5LjA2MiAxMS45NTIgOS4wNjUtLjAwNC0xOC4xMjdaIi8+PC9zdmc+)](https://vscode.stainless.com/mcp/%7B%22name%22%3A%22%40tryfinch%2Ffinch-api-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40tryfinch%2Ffinch-api-mcp%22%5D%2C%22env%22%3A%7B%22FINCH_ACCESS_TOKEN%22%3A%22My%20Access%20Token%22%2C%22FINCH_CLIENT_ID%22%3A%224ab15e51-11ad-49f4-acae-f343b7794375%22%2C%22FINCH_CLIENT_SECRET%22%3A%22My%20Client%20Secret%22%2C%22FINCH_WEBHOOK_SECRET%22%3A%22My%20Webhook%20Secret%22%7D%7D)

> Note: You may need to set environment variables in your MCP client.

Expand All @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application
<!-- x-release-please-start-version -->

```ruby
gem "finch-api", "~> 0.1.0.pre.alpha.42"
gem "finch-api", "~> 0.1.0.pre.alpha.43"
```

<!-- x-release-please-end -->
Expand Down
15 changes: 11 additions & 4 deletions lib/finch_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class Client < FinchAPI::Internal::Transport::BaseClient
# @return [String, nil]
attr_reader :client_secret

# @return [String, nil]
attr_reader :webhook_secret

# @return [FinchAPI::Resources::AccessTokens]
attr_reader :access_tokens

Expand Down Expand Up @@ -56,11 +59,11 @@ class Client < FinchAPI::Internal::Transport::BaseClient

# @api private
#
# @param security [Hash{Symbol=>Boolean}]
#
# @return [Hash{String=>String}]
private def auth_headers
return bearer_auth unless bearer_auth.empty?
return basic_auth unless basic_auth.empty?
{}
private def auth_headers(security:)
{bearer_auth:, basic_auth:}.slice(*security.keys).values.reduce({}, :merge)
end

# @api private
Expand Down Expand Up @@ -90,6 +93,8 @@ class Client < FinchAPI::Internal::Transport::BaseClient
#
# @param access_token [String, nil]
#
# @param webhook_secret [String, nil] Defaults to `ENV["FINCH_WEBHOOK_SECRET"]`
#
# @param base_url [String, nil] Override the default base URL for the API, e.g.,
# `"https://api.example.com/v2/"`. Defaults to `ENV["FINCH_BASE_URL"]`
#
Expand All @@ -104,6 +109,7 @@ def initialize(
client_id: ENV["FINCH_CLIENT_ID"],
client_secret: ENV["FINCH_CLIENT_SECRET"],
access_token: nil,
webhook_secret: ENV["FINCH_WEBHOOK_SECRET"],
base_url: ENV["FINCH_BASE_URL"],
max_retries: self.class::DEFAULT_MAX_RETRIES,
timeout: self.class::DEFAULT_TIMEOUT_IN_SECONDS,
Expand All @@ -119,6 +125,7 @@ def initialize(
@client_id = client_id&.to_s
@client_secret = client_secret&.to_s
@access_token = access_token&.to_s
@webhook_secret = webhook_secret&.to_s

super(
base_url: base_url,
Expand Down
28 changes: 25 additions & 3 deletions lib/finch_api/internal/transport/base_client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,19 @@ class << self
#
# @raise [ArgumentError]
def validate!(req)
keys = [:method, :path, :query, :headers, :body, :unwrap, :page, :stream, :model, :options]
keys = [
:method,
:path,
:query,
:headers,
:body,
:unwrap,
:page,
:stream,
:model,
:security,
:options
]
case req
in Hash
req.each_key do |k|
Expand Down Expand Up @@ -252,6 +264,8 @@ def initialize(
#
# @option req [FinchAPI::Internal::Type::Converter, Class, nil] :model
#
# @option req [Hash{Symbol=>Boolean}, nil] :security
#
# @param opts [Hash{Symbol=>Object}] .
#
# @option opts [String, nil] :idempotency_key
Expand All @@ -276,7 +290,12 @@ def initialize(

headers = FinchAPI::Internal::Util.normalized_headers(
@headers,
auth_headers,
auth_headers(
security: req.fetch(
:security,
{bearer_auth: true, basic_auth: true}
)
),
req[:headers].to_h,
opts[:extra_headers].to_h
)
Expand Down Expand Up @@ -439,7 +458,7 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:)
# Execute the request specified by `req`. This is the method that all resource
# methods call into.
#
# @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, options: {})
# @overload request(method, path, query: {}, headers: {}, body: nil, unwrap: nil, page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, security: {bearer_auth: true, basic_auth: true}, options: {})
#
# @param method [Symbol]
#
Expand All @@ -459,6 +478,8 @@ def send_request(request, redirect_count:, retry_count:, send_retry_header:)
#
# @param model [FinchAPI::Internal::Type::Converter, Class, nil]
#
# @param security [Hash{Symbol=>Boolean}, nil]
#
# @param options [FinchAPI::RequestOptions, Hash{Symbol=>Object}, nil] .
#
# @option options [String, nil] :idempotency_key
Expand Down Expand Up @@ -551,6 +572,7 @@ def inspect
page: T.nilable(T::Class[FinchAPI::Internal::Type::BasePage[FinchAPI::Internal::Type::BaseModel]]),
stream: T.nilable(T::Class[T.anything]),
model: T.nilable(FinchAPI::Internal::Type::Converter::Input),
security: T.nilable({bearer_auth: T::Boolean, basic_auth: T::Boolean}),
options: T.nilable(FinchAPI::RequestOptions::OrHash)
}
end
Expand Down
2 changes: 1 addition & 1 deletion lib/finch_api/internal/transport/pooled_net_requester.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def build_request(request, &blk)

case body
in nil
nil
req["content-length"] ||= 0 unless req["transfer-encoding"]
in String
req["content-length"] ||= body.bytesize.to_s unless req["transfer-encoding"]
req.body_stream = FinchAPI::Internal::Util::ReadIOAdapter.new(body, &blk)
Expand Down
Loading
Loading