Namespaces
Namespaces are a way to organize your policies and shapes. These MUST be declared at the top of a *.sentrie file.
Namespaces form a natural hierarchy using the / delimiter.
A namespace is a container for related:
- policies
- shapes
- child namespaces
Syntax
Section titled “Syntax”-- This is a namespace declarationnamespace fully/qualified/namespace/nameWhere FQN (Fully Qualified Name) is a slash-separated identifier:
namespace com/example/authnamespace com/example/billingnamespace com/company/finance/reportsnamespace mycompany/policies/securitynamespace mycompany/policies/privacy/gdprIn the above example, the namespace nesting looks like this:
com|-- example| |-- auth| |-- billing|-- company| |-- finance| |-- reports
mycompany|-- policies| |-- security| | |-- ...| |-- privacy| | |-- gdpr| | |-- ...- Namespaces must be declared at the top of the file (only comments can be placed before the namespace declaration)
- Only one namespace per file
- Namespace names must be valid identifiers
- Use slash-separated (
/) hierarchical names for organization - Multiple root namespaces are allowed in a policy pack
- Namespace forms the visibility boundary for unexported shapes