delian / node-unifiapi

UniFi API ported to Node.JS
GNU General Public License v3.0
49 stars 19 forks source link

Voucher creation - voucher for desired start and end active date ? #21

Closed Netoperz closed 5 years ago

Netoperz commented 5 years ago

Hello, i need a voucher that will grant access to the network but can be used and validated as active only for specific time with start date and expire date.

Example:

I need to create voucher that will give the access for the user form 9 july 2019 11:23AM to 12 july 2019 12:00 PM, and before and after that date it will be not active but will be available in logs (not deleted) as history of access rights.

Any idea how to do that ?

We can generate the voucher for desired amount of time in hours, and than when the end period of access for that is reached we can revoke the voucher. But this does not block the voucher usage before starting date, and it will shorten the time of validity if usage started early, and needs online connection always for revoking (deleting the voucher that should be deactivated if not used). SO it needs external script to work 24/7 just to add time validation to the voucher validity period control. If there was a way to generate a voucher that will expire without a need of revoking it it would be good for offline voucher management

So any suggestions would be nice to hear, I will pay in beer or vodka (or whiskey) for the solution :D