JoinSEEDS / seeds-smart-contracts

Smart contracts for SEEDS - A Regenerative Civilization Building Game.
https://docs.google.com/document/d/1C4w9Ol8VGabCIcQDVPDrwcTRoJXBqhrb7VjslwQbUGU/edit#heading=h.6f4sxygso816
MIT License
20 stars 6 forks source link

Feature: Expiring policy #415

Closed n13 closed 2 years ago

n13 commented 2 years ago

Expiring policy - set the expiration seconds in the Action call.

Antonio requested this as to be able to implement authentication

New Actions

createexp(name account, string backend_user_id, string device_id, string signature, string policy, uint64_t expiry_seconds);

This is the same as "create" only with an expiry in seconds added to it

see the last field - expiry_seconds

New Tables

expiry

Contains these fields:

int id - id of the policy (foreign key into devicepolicy table)
int created_at - seconds since 1970 timestamp when the policy was created
int valid_until - seconds since 1970 timestamp when the policy expires