Documentation ¶
Overview ¶
Package pim (application Policy Information Model) is used by Hexa tools to validate that a policy is valid for a particular application. The model is based on [Cedar Schema](https://docs.cedarpolicy.com/schema/schema.html).
Index ¶
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActionType ¶
type ActionType struct { MemberOf []string `json:"memberOf,omitempty"` AppliesTo AppliesType `json:"appliesTo,omitempty"` }
Action ::= STR ':' '{' [ '"memberOf"' ':' '[' [ STR { ',' STR } ] ']' ] ',' [ '"appliesTo"' ':' '{' PrincipalTypes ',' ResourceTypes ',' [Context] '}' ] '}'
type AppliesType ¶
type AppliesType struct { PrincipalTypes *PrincipalTypes `json:"principalTypes,omitempty"` ResourceTypes *ResourceTypes `json:"resourceTypes,omitempty"` Context *ContextType `json:"context,omitempty"` }
type AttrType ¶
type AttrType struct { Type string `json:"type"` Name string `json:"name,omitempty"` Required bool `json:"required"` SetType RecordType }
func (AttrType) FindAttrTypes ¶
func (h AttrType) FindAttrTypes(path string, schema SchemaType) *AttrType
type ContextType ¶
type ContextType struct { Type string `json:"type"` // fixed as "RecordType" Attributes map[string]AttrType `json:"attributes"` }
func (ContextType) FindAttrTypes ¶
func (c ContextType) FindAttrTypes(path string, schema SchemaType) *AttrType
type EntityType ¶
type EntityType struct { MemberOfTypes []string `json:"memberOfTypes,omitempty"` Shape ShapeTypes `json:"shape,omitempty"` }
EntityType ::= IDENT ':' '{' [ 'memberOfTypes' ':' '[' [ IDENT { ',' IDENT } ] ']' ] ',' [ 'shape': TypeJson ] '}'
func (EntityType) FindAttrType ¶
func (e EntityType) FindAttrType(path string, schema SchemaType) *AttrType
type Namespaces ¶
type Namespaces map[string]SchemaType
func ParseSchemaFile ¶
func ParseSchemaFile(schemaBytes []byte) (*Namespaces, error)
type PrincipalTypes ¶
type PrincipalTypes []string
type RecordType ¶
type ResourceTypes ¶
type ResourceTypes []string
type SchemaType ¶
type SchemaType struct { EntityTypes map[string]EntityType `json:"entityTypes,omitempty"` Actions map[string]ActionType `json:"actions,omitempty"` CommonTypes map[string]ContextType `json:"commonTypes,omitempty"` }
func (SchemaType) FindAttrType ¶
func (s SchemaType) FindAttrType(entity hexaTypes.Entity) *AttrType
FindAttrType locates an AttrType definition by using the path format: <entityType>:<attr>.<subAttribute>
type ShapeTypes ¶
type ShapeTypes struct { Type string `json:"type"` Attributes map[string]AttrType `json:"attributes"` }
func (ShapeTypes) FindAttrType ¶
func (s ShapeTypes) FindAttrType(path string, schema SchemaType) *AttrType
Click to show internal directories.
Click to hide internal directories.