Skip to content

Evolve API authentication to omit it on endpoints intended to be open #9466

@GPortas

Description

@GPortas

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 the AbstractApiBean.response(DataverseRequestHandler hdl) method, which was called from several endpoints, a method which in turn called the findUserOrDie 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 with AuthRequired

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?

Metadata

Metadata

Assignees

Labels

Feature: APINIH OTA: 1.7.1 (reArchitecture)7 | 1.7.1 | Research & architecture for separating backend and frontend to enable a flexible, sca...Size: 30A percentage of a sprint. 21 hours. (formerly size:33)User Role: API UserMakes use of APIs

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions