Where it goes
Contoso keeps core-party in security/segments/core-party.yaml. The loader reads every YAML file under the package root, so folders are a convention you can change. Name it in lowercase kebab-case. The name must be unique among the package's Segment resources.
Fields
The keys under spec. Nested shapes follow SegmentSpec in the GOL JSON Schema.
| Field | Presence | Shape |
|---|---|---|
include | Required | array |
exclude | Optional | array |
requires | Optional | array |
crossSegmentLinks | Optional | enum: hide, stub |
defaultPolicies | Optional | array |
Syntax and rules
The examples are fragments. Put them in a package next to the resources they reference. A ... stands for a CEL expression you write yourself.
10.4 Segment
The unit of permissioning and deployment. A segment is a named slice of the ontology.
kind: Segment
metadata: { name: procurement-emea, title: Procurement EMEA }
spec:
include:
- { domain: procurement }
- { domain: party, names: [Supplier, Organization] }
- { labels: { tier: core } }
exclude:
- { ref: "procurement.Contract#negotiatedRate" }
requires: ["segment:core-party"] # closure: a segment must contain or require every type its links touch
crossSegmentLinks: stub # how a link to an unseen type is shown: hide | stub ("1 restricted object")
defaultPolicies: ["policy:contracts-by-region"]
Closure is validated: a link whose far end is in no included or required segment is error GLN-E521 under hide and warning GLN-W523 under stub. Links with status: proposed do not count, because they are never deployed.
Check your package
gluon validate examples/contoso
gluon test examples/contoso
validate reports each problem with a GLN code and its place in the file. test runs the package's Test resources. See the language guide and the diagnostics.
