dronefly-garden / dronefly

Red Discord Bot V3 cogs for naturalists.
Other
16 stars 3 forks source link

Allow some cached use of API commands without special permissions #11

Closed synrg closed 5 years ago

synrg commented 5 years ago

Queries that are unlikely to change much from one execution to the next & therefore can benefit from caching with a long retention period could be allowed for anyone, without prior authorization (i.e. accounted to the bot owner's API key for the service, or server/channel API key once that is implemented; see #10 for the latter).

For instance, looking up a any region code (see #7), and performing [p]ebird hybrids command for a given region (using default # of days) should be allowed at least once a day provided each query is cached.

synrg commented 5 years ago

A solution looking for a problem. So far, we don't beat up on either of the two API's supported to date (iNat & eBird). Stateless is simpler for now. This can be reopened later if there's a specific application of the idea where this approach would make a big difference.