Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider returning 404 Not Found for forbidden resources #11563

Open
jacobtylerwalls opened this issue Oct 22, 2024 · 4 comments
Open

Consider returning 404 Not Found for forbidden resources #11563

jacobtylerwalls opened this issue Oct 22, 2024 · 4 comments

Comments

@jacobtylerwalls
Copy link
Member

The resources API returns 403 Forbidden if you lack a read permission on a resource, but this discloses the existence of the resource's primary key.

Suggest returning 404 Not Found instead (like GitHub does for private repos), see discussion at MDN:

Server owners may decide to send a 404 response instead of a 403 if acknowledging the existence of a resource to clients with insufficient privileges is not desired.

@JP-sDEV
Copy link

JP-sDEV commented Oct 22, 2024

Hi can I be assigned this issue?

@jacobtylerwalls
Copy link
Member Author

Thanks for the offer @JP-sDEV. After talking briefly with @ekansa, I think we'll want to promote a little more discussion before implementing this. I'll move this to Needs Discussion in the tracker.

@jacobtylerwalls jacobtylerwalls moved this to 🆕 Under Review/Discussion in pipeline Oct 22, 2024
@JP-sDEV
Copy link

JP-sDEV commented Oct 22, 2024

Sounds good, will stay subscribed for updates.

@ekansa
Copy link

ekansa commented Oct 22, 2024

Just thinking about the 404/403 thing... Should we make this behavior something open to configuration?

There may be "Linked Data" scenarios where someone DOES want to acknowledge the existence of a resource, even if access permissions are not granted. In that situation, a user can learn they have to negotiate access permissions from some authority.

In other circumstances, I can see why some implementers may always want to hide the existence of something, but I don't think this is a universal need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 🆕 Under Review/Discussion
Development

No branches or pull requests

3 participants