To make sure we don't get DDOS'd (among many other things) we should implement some API key middleware. I've started on #1 and figured it would make sense to start with middleware.
Implementation
API key corresponds to one Prisoner
That key is tied to their identity, we used it to store the prisoner's ID in garnet or redis, like key: id
Other stuff will then be tied to each prisoner based on their id, so maybe {prisoner id}: [game ids, ...]?
{game id}: would be a hash that stores some metadata about the game, such as the player IDs of player one and two, the number of games played, etc.
You could see results by looking at {game id}:{prisoner id}: [bool] To see what they played
And of course we would need to decide what endpoints correspond to what...
Issue
To make sure we don't get DDOS'd (among many other things) we should implement some API key middleware. I've started on #1 and figured it would make sense to start with middleware.
Implementation
key: id
{prisoner id}: [game ids, ...]
?{game id}:
would be a hash that stores some metadata about the game, such as the player IDs of player one and two, the number of games played, etc.{game id}:{prisoner id}: [bool]
To see what they playedAnd of course we would need to decide what endpoints correspond to what...