Evolve API authentication to omit it on endpoints intended to be open #9466
Labels
Feature: API
NIH OTA: 1.7.1 (reArchitecture)
7 | 1.7.1 | Research & architecture for separating backend and frontend to enable a flexible, sca...
Size: 30
A percentage of a sprint. 21 hours. (formerly size:33)
User Role: API User
Makes use of APIs
Milestone
Overview of the Feature Request
After #9293 refactor, it has become more visible that there are endpoints that, despite being intended to be open, triggers user authentication, when it is not required.
This behavior already existed before the Auth Filter refactor, but it is now more visible by having the
@AuthRequired
annotation. Before the refactor, credential filtering was executed via theAbstractApiBean.response(DataverseRequestHandler hdl)
method, which was called from several endpoints, a method which in turn called thefindUserOrDie
method.These methods no longer exist, since the logic is now moved to the Auth Filter, and the same endpoints which used those methods now they are wrapped by the Auth Filter.
The goal of this issue is to simplify authentication by omitting the auth filter on endpoints that do not require user authentication. This makes the API code more understandable for developers and improves performance by bypassing the auth filter when it's not needed.
Example endpoint:
/api/info/version
.What kind of user is the feature intended for?
API User, developers
What inspired the request?
Slack discussion about confusion when seeing endpoint
/api/info/version
marked withAuthRequired
What existing behavior do you want changed?
API authentication
Any brand new behavior do you want to add to Dataverse?
No
Any open or closed issues related to this feature request?
The text was updated successfully, but these errors were encountered: