refactor dynamic scripts, expirations and permissions and make it possible to define dynamic script on a service endpoint action