-
-
Notifications
You must be signed in to change notification settings - Fork 53
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
Suggestion on how to prevent potential client-side abuse #3
Comments
Honestly; probably a |
Would work too! |
What if there was a command you could use to go through the project find the tags and store them in a file? Maybe this could be a utility command that populates |
I am not sure I understand why this limitation of 50 rows. I think the DatabaseAnalyticsRepository @ increment method could be written in a single SQL query providing there is a unique key on name insert into
pan (name, impressions, hovers, clicks)
values
('admin-user-mgmt', 0, 0, 0)
on duplicate key update
-- add one or more of the following to update the different type
hovers = (
select
p.hovers + 1
from
pan p
where
name = name
); |
Can someone contribute with a pull request that adds two methods? Pan::analytics()->max(100);
Pan::analytics()->allowed(['name-one', 'name-two']);
Pan::analytics()->unlimited(); |
On it! |
Draft here: #9 |
Hey @nunomaduro thanks for this package, really easy to use. I've been thinking on how to prevent abuse from the FE. It's a tricky one. Maybe instead of directly writing the Something like: <button @pan("my-button")>
<button @pan("my-button-2")> That outputs something like: <button data-pan-34j3jdslk23="my-button">
<button data-pan-asmfj3kjwe="my-button-2"> The BE can then validate the In addition to I think the "tokens" solve one part of the issue, tying the pan to a route solves the second part. We are left with click abusers and page refreshers on steroids... maybe with a debounce we solve that later too 🤷 Let me know what you guys think 👍 |
I think the |
Hey @caendesilva thanks for the feedback. 👍 I was just shooting from the top of my head, I am not 100% sure it may be the correct solution for the problem at hand. It could be a way to make things more difficult, but you can just copy the I will hold for sure, I trust Nuno judgment way more than mine 🙏 Once again, thanks for your input and for raising the question, I think it's something that warrants some brainstorming to try to solve. No one would like to have skewed analytics to take on business decisions 👍 Cheers |
Maybe a "strict" mode could be added, where Pan scans all Blade files for
data-pan
attributes in the HTML, and adds them to a cached array of whitelisted analytic names. This would not work for dynamic attributes but could still be pretty cool I think. That way only names declared on the server-side are accepted.The text was updated successfully, but these errors were encountered: