Skip to content

Commit

Permalink
Anonymous user will get a 401 response when trying to load a schema
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarros committed Nov 16, 2024
1 parent e6286c5 commit 9cf814f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion backend/infrahub/api/dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ async def get_current_user(
if config.SETTINGS.main.allow_anonymous_access and request.method.lower() in ["get", "options"]:
return account_session

if request.method.lower() == "post" and account_session.read_only:
if request.method.lower() == "post" and account_session.read_only and account_session.authenticated:
raise PermissionDeniedError("You are not allowed to perform this operation")

raise AuthorizationError("Authentication is required")
1 change: 1 addition & 0 deletions changelog/+anonymous.fixed.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Anonymous user will get a 401 response when trying to load a schema

0 comments on commit 9cf814f

Please sign in to comment.