Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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"
}
2 changes: 1 addition & 1 deletion .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
config_hash: ccdf6a5b4aaa2a0897c89ac8685d8eb0
18 changes: 18 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Changelog

## 0.1.0-alpha.43 (2026-01-26)

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

* **tests:** skip broken date validation test ([2ee41c8](https://github.com/Finch-API/finch-api-ruby/commit/2ee41c81ef9707aa7180723a283789a5bbaa041d))


### Chores

* **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)
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions lib/finch_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
1 change: 1 addition & 0 deletions lib/finch_api/resources/access_tokens.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def create(params)
path: "auth/token",
body: parsed,
model: FinchAPI::CreateAccessTokenResponse,
security: {},
options: options
)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/finch_api/resources/account.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def disconnect(params = {})
method: :post,
path: "disconnect",
model: FinchAPI::DisconnectResponse,
security: {bearer_auth: true},
options: params[:request_options]
)
end
Expand All @@ -35,6 +36,7 @@ def introspect(params = {})
method: :get,
path: "introspect",
model: FinchAPI::Introspection,
security: {bearer_auth: true},
options: params[:request_options]
)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/finch_api/resources/connect/sessions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def new(params)
path: "connect/sessions",
body: parsed,
model: FinchAPI::Models::Connect::SessionNewResponse,
security: {basic_auth: true},
options: options
)
end
Expand Down Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions lib/finch_api/resources/hris/benefits.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -114,6 +117,7 @@ def list(params = {})
query: parsed,
page: FinchAPI::Internal::SinglePage,
model: FinchAPI::HRIS::CompanyBenefit,
security: {bearer_auth: true},
options: options
)
end
Expand All @@ -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
Expand Down
4 changes: 4 additions & 0 deletions lib/finch_api/resources/hris/benefits/individuals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/company.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ def retrieve(params = {})
path: "employer/company",
query: parsed,
model: FinchAPI::HRIS::HRISCompany,
security: {bearer_auth: true},
options: options
)
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/directory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ def list(params = {})
query: parsed,
page: FinchAPI::Internal::IndividualsPage,
model: FinchAPI::HRIS::IndividualInDirectory,
security: {bearer_auth: true},
options: options
)
end
Expand Down
2 changes: 2 additions & 0 deletions lib/finch_api/resources/hris/documents.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def list(params = {})
path: "employer/documents",
query: parsed,
model: FinchAPI::Models::HRIS::DocumentListResponse,
security: {bearer_auth: true},
options: options
)
end
Expand All @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/employments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/individuals.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/pay_statements.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/hris/payments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def list(params)
query: parsed,
page: FinchAPI::Internal::SinglePage,
model: FinchAPI::HRIS::Payment,
security: {bearer_auth: true},
options: options
)
end
Expand Down
3 changes: 3 additions & 0 deletions lib/finch_api/resources/jobs/automated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def create(params)
path: "jobs/automated",
body: parsed,
model: FinchAPI::Models::Jobs::AutomatedCreateResponse,
security: {bearer_auth: true},
options: options
)
end
Expand All @@ -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
Expand All @@ -82,6 +84,7 @@ def list(params = {})
path: "jobs/automated",
query: parsed,
model: FinchAPI::Models::Jobs::AutomatedListResponse,
security: {bearer_auth: true},
options: options
)
end
Expand Down
1 change: 1 addition & 0 deletions lib/finch_api/resources/jobs/manual.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading
Loading