🐧Scripting language

In order to support migration of static rules (Resource Types, Actions and Policies), we've built a simple DSL (domain specific language) based on LISP type S-expressions.

The expressions are very simple, and always take this form:

(function_name "arg1" "arg2" ...)

Usually S-expressions can be nested, the return value of an expression being the argument of the surrounding expression. However, we decided to keep our language basic, not supporting nesting. This make reading and understanding migration files much easier.

All commands listed below will modify the static rules of your app in some way. They are all idempotent, meaning you can run the same command as many time as you like.

You can include them in versioned migration scripts to be migrated up or down as your app evolves over time. More information in Running migrations.

chevron-rightAdd To Policyhashtag
(atp policy resourceType ...actions)

Adds Action(s) 'actions' on ResourceType 'resourceType' to Policy 'policy'

chevron-rightCreate Actionshashtag
(ca resourceType ...name)

Creates new Action(s) with 'name' on ResourceType 'resourceType'

chevron-rightCreate Policyhashtag
(cp name description)

Creates a new Policy with 'name' and 'description'

chevron-rightCreate Resource Typehashtag
(crt name parent)

Creates a new Resource Type with 'name' and 'parent'

chevron-rightDelete Actionshashtag

Deletes Action(s) with 'resourceType' and 'name'

chevron-rightDelete Policyhashtag

Deletes a Policy with 'name'

chevron-rightDelete Resource Typehashtag

Deletes a Resource Type with 'name'

chevron-rightInvalidate Policyhashtag

Invalidates a Policy with 'name'

Once invalidated, a policy won't be selectable for permissions anymore.

chevron-rightMove Resource Typehashtag

Move a Resource Type with 'name' to parent 'newparent'

chevron-rightRemove From Policyhashtag

Removes Action(s) 'actions' on ResourceType 'resourceType' from Policy 'policy'

chevron-rightRename Actionhashtag

Renames an Action with 'resourceType' and 'name' to 'newname'

chevron-rightRename Policyhashtag

Renames a Policy with 'name' to 'newname'

chevron-rightRename Resource Typehashtag

Renames a Resource Type with 'name' to 'newname'

chevron-rightSet Policy Descriptionhashtag

Sets the description of a Policy with 'name' to 'newdescription'

chevron-rightValidate Policyhashtag

Validates a previously invalidated Policy with 'name'

Once validated, it will be selectable for permissions again.

Last updated