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

Is it cache the false ACL result #278

Open
eydonmlau opened this issue May 15, 2023 · 1 comment
Open

Is it cache the false ACL result #278

eydonmlau opened this issue May 15, 2023 · 1 comment

Comments

@eydonmlau
Copy link

Hi, I use the cache setting like:

auth_opt_cache true
auth_opt_cache_type go-cache
auth_opt_cache_reset true
auth_opt_cache_refresh true

When ACL check is not pass, it would cache all the same like the pass way, Is it correct?
I checked the code, found the code like this:
checkACL
You can imagine a scenario, The first time a gateway(mqtt client) didn't add to application platform, and the acl would not ok first, then the gateway is added to the application platform by user, but acl also would not pass because of the cache. And if the flag auth_opt_cache_refresh was setted, it would never be ok. I feel that this logic is not in line with practical applications.
In this case, what should I do ? may be set the flag auth_opt_cache_refresh=false is the only thing to prevent this case?
best wishes~

@iegomez
Copy link
Owner

iegomez commented May 18, 2023

Yeah, I think you need to disable refreshment altogether or handle it in the connecting side to do an exponential backoff to break the cache seconds you set in order to suit your use case.
If you have a better idea, I'm all ears.

Cheers!

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