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
When a user uses an incorrect schema, it returns the error message with all exposed schemas:
$ curl 'localhost:3000/todos' -H 'Accept-Profile: wrong'
{
...,
"message": "The schema must be one of the following: api, auth_api"
}
For this example, the anon user has not USAGE access to the auth_api schema, but it's still shown.
Solution
It's expected that any exposed schema is already accessible by any request (the burden is on the dev to secure it), but it wouldn't hurt to show only the allowed schemas for the specific role in the error message, i.e.:
$ curl 'localhost:3000/todos' -H 'Accept-Profile: wrong'
{
...,
"message": "The schema must be one of the following: api"
}
Adding the usage to the cached user profile and using it to filter the schemas should do it:
The text was updated successfully, but these errors were encountered:
laurenceisla
added
idea
Needs of discussion to become an enhancement, not ready for implementation
messages
user-facing error/informative messages
labels
Dec 18, 2024
I don't see harm in providing a bit of security through obscurity.
steve-chavez
added
enhancement
a feature, ready for implementation
and removed
idea
Needs of discussion to become an enhancement, not ready for implementation
labels
Dec 19, 2024
Problem
When a user uses an incorrect schema, it returns the error message with all exposed schemas:
For this example, the anon user has not
USAGE
access to theauth_api
schema, but it's still shown.Solution
It's expected that any exposed schema is already accessible by any request (the burden is on the dev to secure it), but it wouldn't hurt to show only the allowed schemas for the specific role in the error message, i.e.:
Adding the usage to the cached user profile and using it to filter the schemas should do it:
postgrest/src/PostgREST/Config/Database.hs
Lines 134 to 135 in 60d92f6
The text was updated successfully, but these errors were encountered: