From ac937c138291704137a33d18cea1571d2e6f96ca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 17:39:43 +0000 Subject: [PATCH 1/8] feat(api): add per endpoint security --- .stats.yml | 2 +- lib/finch_api/client.rb | 8 +- .../internal/transport/base_client.rb | 28 +++- lib/finch_api/resources/access_tokens.rb | 1 + lib/finch_api/resources/account.rb | 2 + lib/finch_api/resources/connect/sessions.rb | 2 + lib/finch_api/resources/hris/benefits.rb | 5 + .../resources/hris/benefits/individuals.rb | 4 + lib/finch_api/resources/hris/company.rb | 1 + .../hris/company/pay_statement_item.rb | 1 + .../hris/company/pay_statement_item/rules.rb | 4 + lib/finch_api/resources/hris/directory.rb | 1 + lib/finch_api/resources/hris/documents.rb | 2 + lib/finch_api/resources/hris/employments.rb | 1 + lib/finch_api/resources/hris/individuals.rb | 1 + .../resources/hris/pay_statements.rb | 1 + lib/finch_api/resources/hris/payments.rb | 1 + lib/finch_api/resources/jobs/automated.rb | 3 + lib/finch_api/resources/jobs/manual.rb | 1 + lib/finch_api/resources/payroll/pay_groups.rb | 2 + lib/finch_api/resources/providers.rb | 1 + lib/finch_api/resources/request_forwarding.rb | 1 + lib/finch_api/resources/sandbox/company.rb | 1 + .../resources/sandbox/connections.rb | 1 + .../resources/sandbox/connections/accounts.rb | 2 + lib/finch_api/resources/sandbox/directory.rb | 1 + lib/finch_api/resources/sandbox/employment.rb | 1 + lib/finch_api/resources/sandbox/individual.rb | 1 + lib/finch_api/resources/sandbox/jobs.rb | 1 + .../resources/sandbox/jobs/configuration.rb | 2 + lib/finch_api/resources/sandbox/payment.rb | 1 + rbi/finch_api/client.rbi | 8 +- .../internal/transport/base_client.rbi | 7 +- sig/finch_api/client.rbs | 4 +- .../internal/transport/base_client.rbs | 2 + test/finch_api/client_test.rb | 120 +++++++++++++++--- test/finch_api/test_helper.rb | 7 +- 37 files changed, 204 insertions(+), 28 deletions(-) diff --git a/.stats.yml b/.stats.yml index b15bfab0..4db1b6f9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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 +config_hash: 83522e0e335cf983f8d2119c1f2bba18 diff --git a/lib/finch_api/client.rb b/lib/finch_api/client.rb index f3330ed8..04735b96 100644 --- a/lib/finch_api/client.rb +++ b/lib/finch_api/client.rb @@ -56,11 +56,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 diff --git a/lib/finch_api/internal/transport/base_client.rb b/lib/finch_api/internal/transport/base_client.rb index af133bbc..4b00c2be 100644 --- a/lib/finch_api/internal/transport/base_client.rb +++ b/lib/finch_api/internal/transport/base_client.rb @@ -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| @@ -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 @@ -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 ) @@ -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] # @@ -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 @@ -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 diff --git a/lib/finch_api/resources/access_tokens.rb b/lib/finch_api/resources/access_tokens.rb index 9efb267d..a3898776 100644 --- a/lib/finch_api/resources/access_tokens.rb +++ b/lib/finch_api/resources/access_tokens.rb @@ -27,6 +27,7 @@ def create(params) path: "auth/token", body: parsed, model: FinchAPI::CreateAccessTokenResponse, + security: {}, options: options ) end diff --git a/lib/finch_api/resources/account.rb b/lib/finch_api/resources/account.rb index 0a8ec282..ebaa9431 100644 --- a/lib/finch_api/resources/account.rb +++ b/lib/finch_api/resources/account.rb @@ -17,6 +17,7 @@ def disconnect(params = {}) method: :post, path: "disconnect", model: FinchAPI::DisconnectResponse, + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -35,6 +36,7 @@ def introspect(params = {}) method: :get, path: "introspect", model: FinchAPI::Introspection, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/connect/sessions.rb b/lib/finch_api/resources/connect/sessions.rb index 3d850a1f..625186cd 100644 --- a/lib/finch_api/resources/connect/sessions.rb +++ b/lib/finch_api/resources/connect/sessions.rb @@ -41,6 +41,7 @@ def new(params) path: "connect/sessions", body: parsed, model: FinchAPI::Models::Connect::SessionNewResponse, + security: {basic_auth: true}, options: options ) end @@ -72,6 +73,7 @@ def reauthenticate(params) path: "connect/sessions/reauthenticate", body: parsed, model: FinchAPI::Models::Connect::SessionReauthenticateResponse, + security: {basic_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/benefits.rb b/lib/finch_api/resources/hris/benefits.rb index 9f72a62d..c9e0ed4a 100644 --- a/lib/finch_api/resources/hris/benefits.rb +++ b/lib/finch_api/resources/hris/benefits.rb @@ -39,6 +39,7 @@ def create(params = {}) query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::HRIS::CreateCompanyBenefitsResponse, + security: {bearer_auth: true}, options: options ) end @@ -63,6 +64,7 @@ def retrieve(benefit_id, params = {}) path: ["employer/benefits/%1$s", benefit_id], query: parsed, model: FinchAPI::HRIS::CompanyBenefit, + security: {bearer_auth: true}, options: options ) end @@ -91,6 +93,7 @@ def update(benefit_id, params = {}) query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::HRIS::UpdateCompanyBenefitResponse, + security: {bearer_auth: true}, options: options ) end @@ -114,6 +117,7 @@ def list(params = {}) query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::CompanyBenefit, + security: {bearer_auth: true}, options: options ) end @@ -137,6 +141,7 @@ def list_supported_benefits(params = {}) query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::SupportedBenefit, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/benefits/individuals.rb b/lib/finch_api/resources/hris/benefits/individuals.rb index 8ec78fa6..5ca102e3 100644 --- a/lib/finch_api/resources/hris/benefits/individuals.rb +++ b/lib/finch_api/resources/hris/benefits/individuals.rb @@ -31,6 +31,7 @@ def enroll_many(benefit_id, params = {}) query: parsed.except(:individuals), body: parsed[:individuals], model: FinchAPI::HRIS::Benefits::EnrolledIndividualBenefitResponse, + security: {bearer_auth: true}, options: options ) end @@ -55,6 +56,7 @@ def enrolled_ids(benefit_id, params = {}) path: ["employer/benefits/%1$s/enrolled", benefit_id], query: parsed, model: FinchAPI::Models::HRIS::Benefits::IndividualEnrolledIDsResponse, + security: {bearer_auth: true}, options: options ) end @@ -86,6 +88,7 @@ def retrieve_many_benefits(benefit_id, params = {}) query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::Benefits::IndividualBenefit, + security: {bearer_auth: true}, options: options ) end @@ -114,6 +117,7 @@ def unenroll_many(benefit_id, params = {}) query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::HRIS::Benefits::UnenrolledIndividualBenefitResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/company.rb b/lib/finch_api/resources/hris/company.rb index 6a93f9fb..11309297 100644 --- a/lib/finch_api/resources/hris/company.rb +++ b/lib/finch_api/resources/hris/company.rb @@ -25,6 +25,7 @@ def retrieve(params = {}) path: "employer/company", query: parsed, model: FinchAPI::HRIS::HRISCompany, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/company/pay_statement_item.rb b/lib/finch_api/resources/hris/company/pay_statement_item.rb index 26bb84ca..88b048b1 100644 --- a/lib/finch_api/resources/hris/company/pay_statement_item.rb +++ b/lib/finch_api/resources/hris/company/pay_statement_item.rb @@ -41,6 +41,7 @@ def list(params = {}) query: parsed, page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::Company::PayStatementItemListResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb b/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb index c7085069..597bcc19 100644 --- a/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb +++ b/lib/finch_api/resources/hris/company/pay_statement_item/rules.rb @@ -43,6 +43,7 @@ def create(params = {}) query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleCreateResponse, + security: {bearer_auth: true}, options: options ) end @@ -71,6 +72,7 @@ def update(rule_id, params = {}) query: parsed.slice(*query_params), body: parsed.except(*query_params), model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleUpdateResponse, + security: {bearer_auth: true}, options: options ) end @@ -94,6 +96,7 @@ def list(params = {}) query: parsed, page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleListResponse, + security: {bearer_auth: true}, options: options ) end @@ -118,6 +121,7 @@ def delete(rule_id, params = {}) path: ["employer/pay-statement-item/rule/%1$s", rule_id], query: parsed, model: FinchAPI::Models::HRIS::Company::PayStatementItem::RuleDeleteResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/directory.rb b/lib/finch_api/resources/hris/directory.rb index d04b348e..d46ee225 100644 --- a/lib/finch_api/resources/hris/directory.rb +++ b/lib/finch_api/resources/hris/directory.rb @@ -27,6 +27,7 @@ def list(params = {}) query: parsed, page: FinchAPI::Internal::IndividualsPage, model: FinchAPI::HRIS::IndividualInDirectory, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/documents.rb b/lib/finch_api/resources/hris/documents.rb index 02ac3131..4b9f78c6 100644 --- a/lib/finch_api/resources/hris/documents.rb +++ b/lib/finch_api/resources/hris/documents.rb @@ -34,6 +34,7 @@ def list(params = {}) path: "employer/documents", query: parsed, model: FinchAPI::Models::HRIS::DocumentListResponse, + security: {bearer_auth: true}, options: options ) end @@ -59,6 +60,7 @@ def retreive(document_id, params = {}) path: ["employer/documents/%1$s", document_id], query: parsed, model: FinchAPI::Models::HRIS::DocumentRetreiveResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/employments.rb b/lib/finch_api/resources/hris/employments.rb index 6609de72..8c04e613 100644 --- a/lib/finch_api/resources/hris/employments.rb +++ b/lib/finch_api/resources/hris/employments.rb @@ -27,6 +27,7 @@ def retrieve_many(params) body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::EmploymentDataResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/individuals.rb b/lib/finch_api/resources/hris/individuals.rb index 9f9182f6..20455946 100644 --- a/lib/finch_api/resources/hris/individuals.rb +++ b/lib/finch_api/resources/hris/individuals.rb @@ -29,6 +29,7 @@ def retrieve_many(params = {}) body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::IndividualResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/pay_statements.rb b/lib/finch_api/resources/hris/pay_statements.rb index 40b48832..53fac6aa 100644 --- a/lib/finch_api/resources/hris/pay_statements.rb +++ b/lib/finch_api/resources/hris/pay_statements.rb @@ -30,6 +30,7 @@ def retrieve_many(params) body: parsed.except(*query_params), page: FinchAPI::Internal::ResponsesPage, model: FinchAPI::HRIS::PayStatementResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/hris/payments.rb b/lib/finch_api/resources/hris/payments.rb index 1079291c..489d73a6 100644 --- a/lib/finch_api/resources/hris/payments.rb +++ b/lib/finch_api/resources/hris/payments.rb @@ -30,6 +30,7 @@ def list(params) query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::HRIS::Payment, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/jobs/automated.rb b/lib/finch_api/resources/jobs/automated.rb index 08853dd8..4e483b59 100644 --- a/lib/finch_api/resources/jobs/automated.rb +++ b/lib/finch_api/resources/jobs/automated.rb @@ -37,6 +37,7 @@ def create(params) path: "jobs/automated", body: parsed, model: FinchAPI::Models::Jobs::AutomatedCreateResponse, + security: {bearer_auth: true}, options: options ) end @@ -56,6 +57,7 @@ def retrieve(job_id, params = {}) method: :get, path: ["jobs/automated/%1$s", job_id], model: FinchAPI::Jobs::AutomatedAsyncJob, + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -82,6 +84,7 @@ def list(params = {}) path: "jobs/automated", query: parsed, model: FinchAPI::Models::Jobs::AutomatedListResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/jobs/manual.rb b/lib/finch_api/resources/jobs/manual.rb index fa482da0..a0cafef7 100644 --- a/lib/finch_api/resources/jobs/manual.rb +++ b/lib/finch_api/resources/jobs/manual.rb @@ -20,6 +20,7 @@ def retrieve(job_id, params = {}) method: :get, path: ["jobs/manual/%1$s", job_id], model: FinchAPI::Jobs::ManualAsyncJob, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/payroll/pay_groups.rb b/lib/finch_api/resources/payroll/pay_groups.rb index da14ff13..2db05d98 100644 --- a/lib/finch_api/resources/payroll/pay_groups.rb +++ b/lib/finch_api/resources/payroll/pay_groups.rb @@ -24,6 +24,7 @@ def retrieve(pay_group_id, params = {}) path: ["employer/pay-groups/%1$s", pay_group_id], query: parsed, model: FinchAPI::Models::Payroll::PayGroupRetrieveResponse, + security: {bearer_auth: true}, options: options ) end @@ -51,6 +52,7 @@ def list(params = {}) query: parsed, page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::Payroll::PayGroupListResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/providers.rb b/lib/finch_api/resources/providers.rb index 7c278011..d4bf5071 100644 --- a/lib/finch_api/resources/providers.rb +++ b/lib/finch_api/resources/providers.rb @@ -18,6 +18,7 @@ def list(params = {}) path: "providers", page: FinchAPI::Internal::SinglePage, model: FinchAPI::Models::ProviderListResponse, + security: {bearer_auth: true}, options: params[:request_options] ) end diff --git a/lib/finch_api/resources/request_forwarding.rb b/lib/finch_api/resources/request_forwarding.rb index 44222145..715a0a8d 100644 --- a/lib/finch_api/resources/request_forwarding.rb +++ b/lib/finch_api/resources/request_forwarding.rb @@ -35,6 +35,7 @@ def forward(params) path: "forward", body: parsed, model: FinchAPI::Models::RequestForwardingForwardResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/company.rb b/lib/finch_api/resources/sandbox/company.rb index 34f959df..68431a86 100644 --- a/lib/finch_api/resources/sandbox/company.rb +++ b/lib/finch_api/resources/sandbox/company.rb @@ -39,6 +39,7 @@ def update(params) path: "sandbox/company", body: parsed, model: FinchAPI::Models::Sandbox::CompanyUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/connections.rb b/lib/finch_api/resources/sandbox/connections.rb index a6c7389f..f8653157 100644 --- a/lib/finch_api/resources/sandbox/connections.rb +++ b/lib/finch_api/resources/sandbox/connections.rb @@ -34,6 +34,7 @@ def create(params) path: "sandbox/connections", body: parsed, model: FinchAPI::Models::Sandbox::ConnectionCreateResponse, + security: {basic_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/connections/accounts.rb b/lib/finch_api/resources/sandbox/connections/accounts.rb index e769c1dc..4b5e7028 100644 --- a/lib/finch_api/resources/sandbox/connections/accounts.rb +++ b/lib/finch_api/resources/sandbox/connections/accounts.rb @@ -32,6 +32,7 @@ def create(params) path: "sandbox/connections/accounts", body: parsed, model: FinchAPI::Models::Sandbox::Connections::AccountCreateResponse, + security: {basic_auth: true}, options: options ) end @@ -54,6 +55,7 @@ def update(params = {}) path: "sandbox/connections/accounts", body: parsed, model: FinchAPI::Models::Sandbox::Connections::AccountUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/directory.rb b/lib/finch_api/resources/sandbox/directory.rb index 1589a91f..d046b784 100644 --- a/lib/finch_api/resources/sandbox/directory.rb +++ b/lib/finch_api/resources/sandbox/directory.rb @@ -25,6 +25,7 @@ def create(params = {}) path: "sandbox/directory", body: parsed[:body], model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Internal::Type::Unknown], + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/employment.rb b/lib/finch_api/resources/sandbox/employment.rb index 2a6b351c..efed725d 100644 --- a/lib/finch_api/resources/sandbox/employment.rb +++ b/lib/finch_api/resources/sandbox/employment.rb @@ -61,6 +61,7 @@ def update(individual_id, params = {}) path: ["sandbox/employment/%1$s", individual_id], body: parsed, model: FinchAPI::Models::Sandbox::EmploymentUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/individual.rb b/lib/finch_api/resources/sandbox/individual.rb index 37b0ab55..d7cf1b0c 100644 --- a/lib/finch_api/resources/sandbox/individual.rb +++ b/lib/finch_api/resources/sandbox/individual.rb @@ -49,6 +49,7 @@ def update(individual_id, params = {}) path: ["sandbox/individual/%1$s", individual_id], body: parsed, model: FinchAPI::Models::Sandbox::IndividualUpdateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/jobs.rb b/lib/finch_api/resources/sandbox/jobs.rb index ee2b236f..0d7de510 100644 --- a/lib/finch_api/resources/sandbox/jobs.rb +++ b/lib/finch_api/resources/sandbox/jobs.rb @@ -25,6 +25,7 @@ def create(params) path: "sandbox/jobs", body: parsed, model: FinchAPI::Models::Sandbox::JobCreateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/jobs/configuration.rb b/lib/finch_api/resources/sandbox/jobs/configuration.rb index 6e21c45e..c9a5800c 100644 --- a/lib/finch_api/resources/sandbox/jobs/configuration.rb +++ b/lib/finch_api/resources/sandbox/jobs/configuration.rb @@ -19,6 +19,7 @@ def retrieve(params = {}) method: :get, path: "sandbox/jobs/configuration", model: FinchAPI::Internal::Type::ArrayOf[FinchAPI::Sandbox::Jobs::SandboxJobConfiguration], + security: {bearer_auth: true}, options: params[:request_options] ) end @@ -41,6 +42,7 @@ def update(params) path: "sandbox/jobs/configuration", body: parsed, model: FinchAPI::Sandbox::Jobs::SandboxJobConfiguration, + security: {bearer_auth: true}, options: options ) end diff --git a/lib/finch_api/resources/sandbox/payment.rb b/lib/finch_api/resources/sandbox/payment.rb index ab0edb7d..e6e97027 100644 --- a/lib/finch_api/resources/sandbox/payment.rb +++ b/lib/finch_api/resources/sandbox/payment.rb @@ -26,6 +26,7 @@ def create(params = {}) path: "sandbox/payment", body: parsed, model: FinchAPI::Models::Sandbox::PaymentCreateResponse, + security: {bearer_auth: true}, options: options ) end diff --git a/rbi/finch_api/client.rbi b/rbi/finch_api/client.rbi index 4c795423..d72ce814 100644 --- a/rbi/finch_api/client.rbi +++ b/rbi/finch_api/client.rbi @@ -50,8 +50,12 @@ module FinchAPI attr_reader :connect # @api private - sig { override.returns(T::Hash[String, String]) } - private def auth_headers + sig do + override + .params(security: { bearer_auth: T::Boolean, basic_auth: T::Boolean }) + .returns(T::Hash[String, String]) + end + private def auth_headers(security:) end # @api private diff --git a/rbi/finch_api/internal/transport/base_client.rbi b/rbi/finch_api/internal/transport/base_client.rbi index 3f33b2f5..4f5573a1 100644 --- a/rbi/finch_api/internal/transport/base_client.rbi +++ b/rbi/finch_api/internal/transport/base_client.rbi @@ -51,6 +51,8 @@ module FinchAPI ), 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 @@ -228,7 +230,7 @@ module FinchAPI # 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: {}) sig do params( method: Symbol, @@ -270,6 +272,8 @@ module FinchAPI ), 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) ).returns(T.anything) end @@ -283,6 +287,7 @@ module FinchAPI page: nil, stream: nil, model: FinchAPI::Internal::Type::Unknown, + security: { bearer_auth: true, basic_auth: true }, options: {} ) end diff --git a/sig/finch_api/client.rbs b/sig/finch_api/client.rbs index f7350df8..5935a270 100644 --- a/sig/finch_api/client.rbs +++ b/sig/finch_api/client.rbs @@ -34,7 +34,9 @@ module FinchAPI attr_reader connect: FinchAPI::Resources::Connect - private def auth_headers: -> ::Hash[String, String] + private def auth_headers: ( + security: { bearer_auth: bool, basic_auth: bool } + ) -> ::Hash[String, String] private def bearer_auth: -> ::Hash[String, String] diff --git a/sig/finch_api/internal/transport/base_client.rbs b/sig/finch_api/internal/transport/base_client.rbs index 70cd492e..ac0445bf 100644 --- a/sig/finch_api/internal/transport/base_client.rbs +++ b/sig/finch_api/internal/transport/base_client.rbs @@ -20,6 +20,7 @@ module FinchAPI page: Class?, stream: Class?, model: FinchAPI::Internal::Type::Converter::input?, + security: { bearer_auth: bool, basic_auth: bool }?, options: FinchAPI::request_opts? } type request_input = @@ -123,6 +124,7 @@ module FinchAPI ?page: Class?, ?stream: Class?, ?model: FinchAPI::Internal::Type::Converter::input?, + ?security: { bearer_auth: bool, basic_auth: bool }?, ?options: FinchAPI::request_opts? ) -> top diff --git a/test/finch_api/client_test.rb b/test/finch_api/client_test.rb index 5208163f..63e0a612 100644 --- a/test/finch_api/client_test.rb +++ b/test/finch_api/client_test.rb @@ -30,7 +30,13 @@ def after_all def test_client_default_request_default_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -43,7 +49,13 @@ def test_client_given_request_default_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 3) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 3 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -55,7 +67,13 @@ def test_client_given_request_default_retry_attempts def test_client_default_request_given_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 3}) @@ -68,7 +86,13 @@ def test_client_given_request_given_retry_attempts stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 3) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 3 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {max_retries: 4}) @@ -85,7 +109,13 @@ def test_client_retry_after_seconds ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -103,7 +133,13 @@ def test_client_retry_after_date ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) assert_raises(FinchAPI::Errors::InternalServerError) do Thread.current.thread_variable_set(:time_now, Time.now) @@ -123,7 +159,13 @@ def test_client_retry_after_ms ) finch = - FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token", max_retries: 1) + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret", + max_retries: 1 + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -136,7 +178,13 @@ def test_client_retry_after_ms def test_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list @@ -150,7 +198,13 @@ def test_retry_count_header def test_omit_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => nil}}) @@ -164,7 +218,13 @@ def test_omit_retry_count_header def test_overwrite_retry_count_header stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 500, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::InternalServerError) do finch.hris.directory.list(request_options: {extra_headers: {"x-stainless-retry-count" => "42"}}) @@ -184,7 +244,13 @@ def test_client_redirect_307 headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) @@ -213,7 +279,13 @@ def test_client_redirect_303 headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {}}) @@ -237,7 +309,13 @@ def test_client_redirect_auth_keep_same_origin headers: {"location" => "/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -264,7 +342,13 @@ def test_client_redirect_auth_strip_cross_origin headers: {"location" => "https://example.com/redirected"} ) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) assert_raises(FinchAPI::Errors::APIConnectionError) do finch.hris.directory.list(request_options: {extra_headers: {"authorization" => "Bearer xyz"}}) @@ -279,7 +363,13 @@ def test_client_redirect_auth_strip_cross_origin def test_default_headers stub_request(:get, "http://localhost/employer/directory").to_return_json(status: 200, body: {}) - finch = FinchAPI::Client.new(base_url: "http://localhost", access_token: "My Access Token") + finch = + FinchAPI::Client.new( + base_url: "http://localhost", + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) finch.hris.directory.list diff --git a/test/finch_api/test_helper.rb b/test/finch_api/test_helper.rb index 2f623e3b..825bb0cf 100644 --- a/test/finch_api/test_helper.rb +++ b/test/finch_api/test_helper.rb @@ -48,7 +48,12 @@ class FinchAPI::Test::SingletonClient < FinchAPI::Client TEST_API_BASE_URL = ENV.fetch("TEST_API_BASE_URL", "http://localhost:4010") def initialize - super(base_url: FinchAPI::Test::SingletonClient::TEST_API_BASE_URL, access_token: "My Access Token") + super( + base_url: FinchAPI::Test::SingletonClient::TEST_API_BASE_URL, + access_token: "My Access Token", + client_id: "4ab15e51-11ad-49f4-acae-f343b7794375", + client_secret: "My Client Secret" + ) end end From a021ffb4eec64de459cb22c27b4c7c4592003d21 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 12:54:35 +0000 Subject: [PATCH 2/8] chore(internal): codegen related update --- .../resources/hris/directory_test.rb | 20 ++++--------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/test/finch_api/resources/hris/directory_test.rb b/test/finch_api/resources/hris/directory_test.rb index 07b3310d..95bbda88 100644 --- a/test/finch_api/resources/hris/directory_test.rb +++ b/test/finch_api/resources/hris/directory_test.rb @@ -34,25 +34,13 @@ def test_list_individuals response = @finch.hris.directory.list_individuals assert_pattern do - response => FinchAPI::Internal::IndividualsPage - end - - row = response.to_enum.first - return if row.nil? - - assert_pattern do - row => FinchAPI::HRIS::IndividualInDirectory + response => FinchAPI::UnnamedTypeWithNoPropertyInfoOrParent0 end assert_pattern do - row => { - id: String, - department: FinchAPI::HRIS::IndividualInDirectory::Department | nil, - first_name: String | nil, - is_active: FinchAPI::Internal::Type::Boolean | nil, - last_name: String | nil, - manager: FinchAPI::HRIS::IndividualInDirectory::Manager | nil, - middle_name: String | nil + response => { + individuals: ^(FinchAPI::Internal::Type::ArrayOf[FinchAPI::HRIS::IndividualInDirectory]), + paging: FinchAPI::Paging } end end From 2ee41c81ef9707aa7180723a283789a5bbaa041d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 18:34:44 +0000 Subject: [PATCH 3/8] fix(tests): skip broken date validation test --- .stats.yml | 2 +- test/finch_api/resources/access_tokens_test.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 4db1b6f9..072a0a86 100644 --- a/.stats.yml +++ b/.stats.yml @@ -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: 83522e0e335cf983f8d2119c1f2bba18 +config_hash: ccdf6a5b4aaa2a0897c89ac8685d8eb0 diff --git a/test/finch_api/resources/access_tokens_test.rb b/test/finch_api/resources/access_tokens_test.rb index ecc07d83..e57c33f9 100644 --- a/test/finch_api/resources/access_tokens_test.rb +++ b/test/finch_api/resources/access_tokens_test.rb @@ -4,6 +4,8 @@ class FinchAPI::Test::Resources::AccessTokensTest < FinchAPI::Test::ResourceTest def test_create_required_params + skip("prism doesnt like the format for the API-Version header") + response = @finch.access_tokens.create(code: "code") assert_pattern do From 8022436ca504321dffdb8eedabc0c9ee82e0bf45 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 16:36:32 +0000 Subject: [PATCH 4/8] fix(docs): fix mcp installation instructions for remote servers --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8085e54e..6877f1c4 100644 --- a/README.md +++ b/README.md @@ -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. From 66e8f668ba49f9959bd0067d4161d972ebad46ee Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 14:42:17 +0000 Subject: [PATCH 5/8] fix(client): always add content-length to post body, even when empty --- lib/finch_api/internal/transport/pooled_net_requester.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/finch_api/internal/transport/pooled_net_requester.rb b/lib/finch_api/internal/transport/pooled_net_requester.rb index 97752aef..d8edf1aa 100644 --- a/lib/finch_api/internal/transport/pooled_net_requester.rb +++ b/lib/finch_api/internal/transport/pooled_net_requester.rb @@ -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) From 57bc88cdd60bfec535752170ffeeebe157a0bfce Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 4 Feb 2026 01:22:39 +0000 Subject: [PATCH 6/8] chore(docs): remove www prefix --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b1bc266a..7c49ee8a 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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' '' +$ git clone -- 'https://github.com/Finch-API/finch-api-ruby' '' ``` ```ruby From 7bc3e6509545d52948558cc20180865f09e946dc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 17:21:23 +0000 Subject: [PATCH 7/8] fix(client): loosen json header parsing --- lib/finch_api/internal/util.rb | 2 +- rbi/finch_api/internal/util.rbi | 2 +- test/finch_api/internal/util_test.rb | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/finch_api/internal/util.rb b/lib/finch_api/internal/util.rb index 6c29c988..1123afb8 100644 --- a/lib/finch_api/internal/util.rb +++ b/lib/finch_api/internal/util.rb @@ -485,7 +485,7 @@ def writable_enum(&blk) end # @type [Regexp] - JSON_CONTENT = %r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)} + JSON_CONTENT = %r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)} # @type [Regexp] JSONL_CONTENT = %r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)} diff --git a/rbi/finch_api/internal/util.rbi b/rbi/finch_api/internal/util.rbi index 0bccd650..00a09891 100644 --- a/rbi/finch_api/internal/util.rbi +++ b/rbi/finch_api/internal/util.rbi @@ -296,7 +296,7 @@ module FinchAPI end JSON_CONTENT = - T.let(%r{^application/(?:vnd(?:\.[^.]+)*\+)?json(?!l)}, Regexp) + T.let(%r{^application/(?:[a-zA-Z0-9.-]+\+)?json(?!l)}, Regexp) JSONL_CONTENT = T.let(%r{^application/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)}, Regexp) diff --git a/test/finch_api/internal/util_test.rb b/test/finch_api/internal/util_test.rb index f3cd1297..c49c904d 100644 --- a/test/finch_api/internal/util_test.rb +++ b/test/finch_api/internal/util_test.rb @@ -171,6 +171,8 @@ def test_json_content cases = { "application/json" => true, "application/jsonl" => false, + "application/arbitrary+json" => true, + "application/ARBITRARY+json" => true, "application/vnd.github.v3+json" => true, "application/vnd.api+json" => true } From 05193a1edff2d6fc7b28592837982ace986e17ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 6 Feb 2026 17:21:43 +0000 Subject: [PATCH 8/8] release: 0.1.0-alpha.43 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 22 ++++++++++++++++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/finch_api/version.rb | 2 +- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 859ebd32..76293726 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.1.0-alpha.42" + ".": "0.1.0-alpha.43" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 25e9d9dd..75aa1222 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 0.1.0-alpha.43 (2026-02-06) + +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)) + + +### Bug Fixes + +* **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)) +* **tests:** skip broken date validation test ([2ee41c8](https://github.com/Finch-API/finch-api-ruby/commit/2ee41c81ef9707aa7180723a283789a5bbaa041d)) + + +### Chores + +* **docs:** remove www prefix ([57bc88c](https://github.com/Finch-API/finch-api-ruby/commit/57bc88cdd60bfec535752170ffeeebe157a0bfce)) +* **internal:** codegen related update ([a021ffb](https://github.com/Finch-API/finch-api-ruby/commit/a021ffb4eec64de459cb22c27b4c7c4592003d21)) + ## 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) diff --git a/Gemfile.lock b/Gemfile.lock index 01a79a1a..86f1478c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/README.md b/README.md index 6877f1c4..d2caebca 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "finch-api", "~> 0.1.0.pre.alpha.42" +gem "finch-api", "~> 0.1.0.pre.alpha.43" ``` diff --git a/lib/finch_api/version.rb b/lib/finch_api/version.rb index b6329508..d0a78b57 100644 --- a/lib/finch_api/version.rb +++ b/lib/finch_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module FinchAPI - VERSION = "0.1.0.pre.alpha.42" + VERSION = "0.1.0.pre.alpha.43" end