Logic to extend allowed IP or remove expired one

Antoine - May 17 '20 - - Dev Community

Photo by Alvaro Reyes on Unsplash

In order to keep the process of extending IP minimal, it's crucial to extend the lifespan of allowed IP if it's hasn't changed.

Information

To do that we rely on the following information in the log:

  • the IP
  • a unique IP mapped from user's identity
  • an expiration date

Update Flow

Those simple information let us perform the following link

Alt Text

Durable Framework allow us to fire and forget instance. We just need to check if an IP is still valid in the record before delete it.
The logic to do it will be the following

Alt Text

Log

As a log, we use Azure Storage Table with:

  • the unique ID as a PartitionKey
  • IP as a RowKey
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player