Skip to content

Release 9.1.1: slim down default context, drop ClientId service#287

Draft
bartes wants to merge 2 commits into
developfrom
9.1.1
Draft

Release 9.1.1: slim down default context, drop ClientId service#287
bartes wants to merge 2 commits into
developfrom
9.1.1

Conversation

@bartes
Copy link
Copy Markdown
Contributor

@bartes bartes commented Jun 1, 2026

What & why

Some housekeeping around the default request context we build in Castle::Context::GetDefault. It now carries just headers, ip and library — the client_id, active, user_agent and locale fields were redundant since that data already travels in headers, so I've trimmed them along with the internal Castle::ClientId::Extract service that backed client_id.

Shipping as a patch (9.1.09.1.1): this is housekeeping on internal/derivable data, not a feature or an intentional API change.

Changes

  • Default context is now { headers:, ip:, library: }.
  • Dropped the internal Castle::ClientId::Extract service (class + spec) and its lib/castle.rb require.
  • Simplified Castle::Context::GetDefault#initialize to take only request (the cookies argument and unused ivars are gone) and updated Context::Prepare accordingly.
  • Updated the affected specs.
  • Bumped VERSION to 9.1.1, refreshed Gemfile.lock, added the CHANGELOG entry.

Known limitations

  • The public cookies option on Castle::Client.from_request / Castle::Context::Prepare.call is now a no-op — its only consumer was the removed ClientId service. I've left the signature untouched to avoid a gratuitous public API change; happy to drop it in a follow-up if we'd rather not carry a dead option.

bartes added 2 commits June 1, 2026 13:46
Reduce the default request context to headers, ip and library, and remove
the now-unused Castle::ClientId::Extract service plus the cookies plumbing
in Castle::Context::GetDefault. The dropped context fields (client_id,
active, user_agent, locale) are already derivable from headers.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant