You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deprecate positional options Hash in Auth DSL; use keyword arguments
`Grape::Middleware::Auth::DSL#auth`, `#http_basic` and `#http_digest`
now take their options as keyword arguments. Passing a positional
options Hash still works but emits a Grape.deprecator warning and is
merged into the keyword options, so downstream callers keep working
through the deprecation cycle. Internal delegation splats (`**options`)
so the helper methods don't self-trigger the deprecation.
Mirrors the `desc(description, **options)` deprecation (#2723).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
*[#2726](https://github.com/ruby-grape/grape/pull/2726): Reuse one `AttributesIterator` per validator and drop the unused `Enumerable` mixin - [@ericproulx](https://github.com/ericproulx).
44
+
*[#2728](https://github.com/ruby-grape/grape/pull/2728): Deprecate passing a positional options Hash to `auth`/`http_basic`/`http_digest`; pass keyword arguments instead - [@ericproulx](https://github.com/ericproulx).
Copy file name to clipboardExpand all lines: UPGRADING.md
+24Lines changed: 24 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,6 +3,30 @@ Upgrading Grape
3
3
4
4
### Upgrading to >= 3.3
5
5
6
+
#### `auth`, `http_basic` and `http_digest` now take keyword arguments
7
+
8
+
`Grape::Middleware::Auth::DSL#auth`, `#http_basic` and `#http_digest` now accept their options as keyword arguments instead of a positional `Hash`. Calls using bare keyword syntax or a block are unaffected:
`Grape::Middleware::Globals` and the three env constants it set (`Grape::Env::GRAPE_REQUEST`, `Grape::Env::GRAPE_REQUEST_HEADERS`, `Grape::Env::GRAPE_REQUEST_PARAMS`) have been deleted. The middleware was introduced in 2013 (commit `9987090b`) but never mounted by Grape's own stack — the `Grape::Request` it built is now constructed directly inside `Grape::Endpoint`. Nothing in `lib/` read those env keys.
0 commit comments