A programmatic AST is now available in the ast package.
Policy sets can be marshaled and unmarshaled from JSON.
Policies can also be marshaled to Cedar text.
Upgrading from 0.1.x to 0.2.x
The Cedar value types have moved from the cedar package to the types package.
The PolicyIDs are now strings, previously they were numeric.
Errors and reasons use the new PolicyID form.
Combining multiple parsed Cedar files now involves coming up with IDs for each
statement in those files. It's best to create an empty NewPolicySet then
parse individual files using NewPolicyListFromBytes and subsequently use
PolicySet.Store to add each of the policy statements.
The Cedar Entity and Entities types have moved from the cedar package to the types package.
Stronger typing is being used in many places.
The Value method Cedar() string was changed to MarshalCedar() []byte
New features in 0.2.x
ast
package.Upgrading from 0.1.x to 0.2.x
cedar
package to thetypes
package.strings
, previously they were numeric.PolicyID
form.NewPolicySet
then parse individual files usingNewPolicyListFromBytes
and subsequently usePolicySet.Store
to add each of the policy statements.Entity
andEntities
types have moved from thecedar
package to thetypes
package.Value
methodCedar() string
was changed toMarshalCedar() []byte