MCPcopy Create free account
hub / github.com/elimity-com/scim / validateSubAttribute

Function validateSubAttribute

internal/filter/filter.go:74–83  ·  view source on GitHub ↗

validateSubAttribute checks whether the given attribute name is a attribute within the given reference attribute.

(attr schema.CoreAttribute, subAttrName string)

Source from the content-addressed store, hash-verified

72
73// validateSubAttribute checks whether the given attribute name is a attribute within the given reference attribute.
74func validateSubAttribute(attr schema.CoreAttribute, subAttrName string) error {
75 if !attr.HasSubAttributes() {
76 return fmt.Errorf("the attribute has no sub-attributes")
77 }
78
79 if _, ok := attr.SubAttributes().ContainsAttribute(subAttrName); !ok {
80 return fmt.Errorf("the attribute has no sub-attributes named: %s", subAttrName)
81 }
82 return nil
83}
84
85// Validator represents a filter validator.
86type Validator struct {

Callers 2

validateAttributePathFunction · 0.85
validatePathMethod · 0.85

Calls 3

HasSubAttributesMethod · 0.80
ContainsAttributeMethod · 0.80
SubAttributesMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…