Git Product home page Git Product logo

Comments (5)

topaz avatar topaz commented on June 28, 2024 2

Looks great!

from advent-of-code-data.

wimglenn avatar wimglenn commented on June 28, 2024

Hi Eric,

Thanks for your work on AoC!

OK, I will make v0.3 memoize the puzzle inputs and persist that data to a file storage.

It's not really possible to prevent people abusing the site by calling get_data in a loop client-side, any counter-measure I put in would be easily reversed. The responsibility for rate-limiting is better handled server-side.

What I can do is prevent a new request if the time of the last request was just 5~10 seconds ago. But it would only prevent users who made stupid mistake, it's unlikely going to stop a malicious user that wants to DoS you. Let me know what you think.

Thanks and regards,
Wim

from advent-of-code-data.

topaz avatar topaz commented on June 28, 2024

I'm not trying to stop malicious users; they have substantially better ways of executing an attack than your library. I'm trying to avoid beginners (of whom there are many doing AoC) from thinking they'll be clever and stick the method in a loop without realizing the implications.

I just posted a new thread on the subreddit since I'm seeing libraries like this more frequently lately:

https://www.reddit.com/r/adventofcode/comments/5gefzc/only_you_can_prevent_ddos_attacks_on_aoc/

from advent-of-code-data.

wimglenn avatar wimglenn commented on June 28, 2024

@topaz The latest release includes client-side rate limiting on get_data (1 request per 10 seconds) and saves the inputs to disk for later re-use. Please have a look at it and let me know if it addresses all your concerns. If there are no further changes needed, you may close this issue. Cheers 🍺

from advent-of-code-data.

topaz avatar topaz commented on June 28, 2024

One more minor change: if this is going to be widely deployed in places like pypi, please set a unique user agent so this library can be identified in my logs.

from advent-of-code-data.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.