e13h / gsheets-plaid

Bringing bank transactions into Google Sheets with Plaid
GNU General Public License v3.0
14 stars 2 forks source link

Bypass restrictions when running locally #15

Closed e13h closed 2 years ago

e13h commented 2 years ago

Currently there is a restriction that prohibits you from syncing more than once every 12 hours (arbitrary, I know).

https://github.com/evanphilipsmith/gsheets-plaid/blob/fba22d39d019183bdd4cb72895646be22bffff8f/gsheets_plaid/web_server/main.py#L261

This is helpful when hosting the web server online to prevent a malicious (or unknowing) user from abusing the API and racking up costs. However, when run on a local machine, this restriction is unnecessary and even annoying.

Perhaps we could add a flag (environment variable, or something else) that is configured when launching the web server (so that when hosted on the internet we enable restrictions, but when hosted locally we can bypass them). For example:

if enable_restrictions and not user_allowed_sync(session_data):