Skip to content

Remove Rack::Auth::Digest - #2361

Merged
dblock merged 12 commits into
ruby-grape:masterfrom
ninoseki:remove-Rack-Auth-Digest
Oct 25, 2023
Merged

Remove Rack::Auth::Digest#2361
dblock merged 12 commits into
ruby-grape:masterfrom
ninoseki:remove-Rack-Auth-Digest

Conversation

@ninoseki

Copy link
Copy Markdown
Contributor

Remove Rack::Auth::Digest.

As far as I understand, #2294 reaches a conclusion that removing Rack::Auth::Digest is the way to go.

(It's my first time to make a PR to this repository. So please let me know if I miss something)

@dblock

dblock commented Oct 24, 2023

Copy link
Copy Markdown
Member

Let's document this in UPGRADING, please?

I think we can start following major version semver from here, and bump the version of Grape to 2.0 in this PR since this is a visibly breaking change? Could you please do it?

@ninoseki

Copy link
Copy Markdown
Contributor Author

Sure, I updated README, CHANGELOG and also UPGRADING. Let me know if it's not enough or if I miss something.

@dblock dblock left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 more places: The README has a "Stable Version" section that will need to say next is 2.0.

Comment thread CHANGELOG.md
Comment thread CHANGELOG.md Outdated
@ninoseki
ninoseki requested a review from dblock October 25, 2023 12:45
@dblock

dblock commented Oct 25, 2023

Copy link
Copy Markdown
Member

README#stable-release still needs a bump to 2.0, please?

@ninoseki

Copy link
Copy Markdown
Contributor Author

README#stable-release still needs a bump to 2.0, please?

Oops, I updated it by 4905cc6.

@dblock
dblock merged commit 4753f67 into ruby-grape:master Oct 25, 2023
@ninoseki
ninoseki deleted the remove-Rack-Auth-Digest branch October 25, 2023 23:58
@ericproulx ericproulx mentioned this pull request Aug 1, 2026
5 tasks
ericproulx added a commit that referenced this pull request Aug 1, 2026
Nothing it could reach has existed since 2.0.0. #2361 removed
Rack::Auth::Digest and Grape's :http_digest strategy after Rack 3 dropped
digest authentication, but Grape::Middleware::Auth::DSL#http_digest survived
and kept recording its settings, so an API declaring it still booted --
and then raised Grape::Exceptions::UnknownAuthStrategy on the first request,
from inside the middleware build, as an uncaught exception rather than a
response. A misconfiguration only visible in production.

The 4.0 UPGRADING notes still used `auth :http_digest, realm: 'API', opaque:
'secret'` as a worked example of a supported call, so the documentation
pointed at it too. That section is rewritten, and the removal documented.

Removing the sugar rather than validating the strategy when `auth` is called:
#auth deliberately records whatever it is given and resolves the strategy when
the middleware is built, which is what lets an application register its own.
That contract is specified -- validating early breaks it, and would break
registering a strategy after the API class is defined. `auth :http_digest`
therefore still works for anyone who registered one; only the sugar is gone,
along with the two defaults it supplied (realm 'API Authorization', opaque
'secret'), which UPGRADING spells out.

The DSL specs used :http_digest as their example label for #auth itself. They
now use a neutral :custom, which keeps the distinction the specs are actually
about: #auth records a label, the strategy behind it is looked up later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
ericproulx added a commit that referenced this pull request Aug 1, 2026
Nothing it could reach has existed since 2.0.0. #2361 removed
Rack::Auth::Digest and Grape's :http_digest strategy after Rack 3 dropped
digest authentication, but Grape::Middleware::Auth::DSL#http_digest survived
and kept recording its settings, so an API declaring it still booted --
and then raised Grape::Exceptions::UnknownAuthStrategy on the first request,
from inside the middleware build, as an uncaught exception rather than a
response. A misconfiguration only visible in production.

The 4.0 UPGRADING notes still used `auth :http_digest, realm: 'API', opaque:
'secret'` as a worked example of a supported call, so the documentation
pointed at it too. That section is rewritten, and the removal documented.

Removing the sugar rather than validating the strategy when `auth` is called:
#auth deliberately records whatever it is given and resolves the strategy when
the middleware is built, which is what lets an application register its own.
That contract is specified -- validating early breaks it, and would break
registering a strategy after the API class is defined. `auth :http_digest`
therefore still works for anyone who registered one; only the sugar is gone,
along with the two defaults it supplied (realm 'API Authorization', opaque
'secret'), which UPGRADING spells out.

The DSL specs used :http_digest as their example label for #auth itself. They
now use a neutral :custom, which keeps the distinction the specs are actually
about: #auth records a label, the strategy behind it is looked up later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 2e12a20)
ericproulx added a commit that referenced this pull request Aug 1, 2026
Nothing it could reach has existed since 2.0.0. #2361 removed
Rack::Auth::Digest and Grape's :http_digest strategy after Rack 3 dropped
digest authentication, but Grape::Middleware::Auth::DSL#http_digest survived
and kept recording its settings, so an API declaring it still booted --
and then raised Grape::Exceptions::UnknownAuthStrategy on the first request,
from inside the middleware build, as an uncaught exception rather than a
response. A misconfiguration only visible in production.

The 4.0 UPGRADING notes still used `auth :http_digest, realm: 'API', opaque:
'secret'` as a worked example of a supported call, so the documentation
pointed at it too. That section is rewritten, and the removal documented.

Removing the sugar rather than validating the strategy when `auth` is called:
#auth deliberately records whatever it is given and resolves the strategy when
the middleware is built, which is what lets an application register its own.
That contract is specified -- validating early breaks it, and would break
registering a strategy after the API class is defined. `auth :http_digest`
therefore still works for anyone who registered one; only the sugar is gone,
along with the two defaults it supplied (realm 'API Authorization', opaque
'secret'), which UPGRADING spells out.

The DSL specs used :http_digest as their example label for #auth itself. They
now use a neutral :custom, which keeps the distinction the specs are actually
about: #auth records a label, the strategy behind it is looked up later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 2e12a20)
ericproulx added a commit that referenced this pull request Aug 1, 2026
Nothing it could reach has existed since 2.0.0. #2361 removed
Rack::Auth::Digest and Grape's :http_digest strategy after Rack 3 dropped
digest authentication, but Grape::Middleware::Auth::DSL#http_digest survived
and kept recording its settings, so an API declaring it still booted --
and then raised Grape::Exceptions::UnknownAuthStrategy on the first request,
from inside the middleware build, as an uncaught exception rather than a
response. A misconfiguration only visible in production.

The 4.0 UPGRADING notes still used `auth :http_digest, realm: 'API', opaque:
'secret'` as a worked example of a supported call, so the documentation
pointed at it too. That section is rewritten, and the removal documented.

Removing the sugar rather than validating the strategy when `auth` is called:
#auth deliberately records whatever it is given and resolves the strategy when
the middleware is built, which is what lets an application register its own.
That contract is specified -- validating early breaks it, and would break
registering a strategy after the API class is defined. `auth :http_digest`
therefore still works for anyone who registered one; only the sugar is gone,
along with the two defaults it supplied (realm 'API Authorization', opaque
'secret'), which UPGRADING spells out.

The DSL specs used :http_digest as their example label for #auth itself. They
now use a neutral :custom, which keeps the distinction the specs are actually
about: #auth records a label, the strategy behind it is looked up later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
(cherry picked from commit 2e12a20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants