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

HTTP super user route called even if ACL yet defined in file backend #332

Open
Bacto opened this issue Aug 29, 2024 · 3 comments
Open

HTTP super user route called even if ACL yet defined in file backend #332

Bacto opened this issue Aug 29, 2024 · 3 comments

Comments

@Bacto
Copy link

Bacto commented Aug 29, 2024

Hi,

First I would like to thank you for your very useful authentication system!

I'm using it with 2 backends: file and http.

I have a user created in the file backend.
I added an equivalent of super user to this user using the following ACL file rule:

user myUser
topic readwrite #

When this user connects, thesuper user route on the http backend is always called.

I think this is not the expected behavior as the user is yet a super user.

Is there a way to avoid this situation?
My problem is that it overloads the http backend unnecessarily.

Thanks,
Adrien

@iegomez
Copy link
Owner

iegomez commented Aug 29, 2024

Sadly, unless you disable super user checks for http backend or globally, you'll get this behavior because checking an ACL first loops through superuser enabled backends to check for it, and then loops through backends to check the ACL.

I could add an option to instead of checking superuser for all backends and then acl for them, looping through backends and checking superuser and acl individually on them before trying next backend.
That way, if files was registered before http you'd get what you expect.

But that's not implemented right now, so the short answer is the first comment: only way is to disable super user checks for http or generally.

@Bacto
Copy link
Author

Bacto commented Aug 29, 2024

Thanks for your prompt reply @iegomez!

Having an option to check superuser and ACL at the same time would be perfect.

Is there any way to sponsor the feature?

@iegomez
Copy link
Owner

iegomez commented Aug 29, 2024

Inverting the loop logic on a flag should be simple enough to implement, the only caveat is that I need to introduce ordering to backends as well.
I'll let you know when I take a stab at it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants