From 44fc9efc61ccd9cec51fd6ca95293c4bf80d3a63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 09:43:13 +0000 Subject: [PATCH 1/3] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 423ab65..ccd7c79 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 27 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/moderation-api%2Fmoderation-api-c8e66e827fc2b1465b740a29e87da71c3b1ddca1a4bdb1023aa96c569b80e9be.yml openapi_spec_hash: 35fdc3e34feb56cafaf4de2834201978 -config_hash: 0a024bca1710e3a3194925edfedc513c +config_hash: 13d10207114afb65f7ac4e21f4c0e358 From 298817593f2f217bd57565a76b38345097799ebf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 02:54:44 +0000 Subject: [PATCH 2/3] feat: support setting headers via env --- lib/moderation_api/client.rb | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/moderation_api/client.rb b/lib/moderation_api/client.rb index 8282cbd..85fc936 100644 --- a/lib/moderation_api/client.rb +++ b/lib/moderation_api/client.rb @@ -76,6 +76,19 @@ def initialize( raise ArgumentError.new("secret_key is required, and can be set via environ: \"MODAPI_SECRET_KEY\"") end + headers = {} + custom_headers_env = ENV["MODERATION_API_CUSTOM_HEADERS"] + unless custom_headers_env.nil? + parsed = {} + custom_headers_env.split("\n").each do |line| + colon = line.index(":") + unless colon.nil? + parsed[line[0...colon].strip] = line[(colon + 1)..].strip + end + end + headers = parsed.merge(headers) + end + @secret_key = secret_key.to_s super( @@ -83,7 +96,8 @@ def initialize( timeout: timeout, max_retries: max_retries, initial_retry_delay: initial_retry_delay, - max_retry_delay: max_retry_delay + max_retry_delay: max_retry_delay, + headers: headers ) @authors = ModerationAPI::Resources::Authors.new(client: self) From 05e0d37f586c328024a2dad4af537d51aa77525c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 28 Apr 2026 03:07:29 +0000 Subject: [PATCH 3/3] release: 2.13.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ Gemfile.lock | 2 +- README.md | 2 +- lib/moderation_api/version.rb | 2 +- 5 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 0746cbe..e6eadb4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "2.12.0" + ".": "2.13.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 29a815a..0e26d08 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 2.13.0 (2026-04-28) + +Full Changelog: [v2.12.0...v2.13.0](https://github.com/moderation-api/sdk-ruby/compare/v2.12.0...v2.13.0) + +### Features + +* support setting headers via env ([2988175](https://github.com/moderation-api/sdk-ruby/commit/298817593f2f217bd57565a76b38345097799ebf)) + ## 2.12.0 (2026-04-24) Full Changelog: [v2.11.3...v2.12.0](https://github.com/moderation-api/sdk-ruby/compare/v2.11.3...v2.12.0) diff --git a/Gemfile.lock b/Gemfile.lock index 24e3355..0385c95 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - moderation_api (2.12.0) + moderation_api (2.13.0) cgi connection_pool diff --git a/README.md b/README.md index cf53987..baeb35d 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ To use this gem, install via Bundler by adding the following to your application ```ruby -gem "moderation_api", "~> 2.12.0" +gem "moderation_api", "~> 2.13.0" ``` diff --git a/lib/moderation_api/version.rb b/lib/moderation_api/version.rb index 3a01059..cfd406e 100644 --- a/lib/moderation_api/version.rb +++ b/lib/moderation_api/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module ModerationAPI - VERSION = "2.12.0" + VERSION = "2.13.0" end