AttrPaths

The logic in this module extracts the path sent in a filter query.

PATCH calls pass a path key-value pair in the payload:

Valid examples of "path" are as follows:

    "path":"members"

    "path":"name.familyName"

    "path":"addresses[type eq "work"]"

    "path":"members[value eq
           "2819c223-7f76-453a-919d-413861904646"]"

    "path":"members[value eq
           "2819c223-7f76-453a-919d-413861904646"].displayName"

                    Figure 8: Example Path Values

Those paths can be simple or complex. The “valuePath” rule allows specific values of a complex multi-valued attribute to be selected:

RFC 7644, Figure 7: SCIM PATCH PATH Rule, ABNF:

    PATH = attrPath / valuePath [subAttr]

The classes in this module parse the overall PATH string for its parts so that they can be easily used in following code.

class scim2_filter_parser.attr_paths.AttrPath(filter_: str, attr_map: dict)

This class depends on the SQL transpiler.

first_path

Return first path in list of parsed attr paths.

is_complex

Return true if AttrPath has multiple levels within it. Eg:

"members[value eq "2819c223-7f76-453a-919d-413861904646"]"

The following example is a simple (or not complex) AttrPath:

"name.familyName"
params_by_attr_paths

Return the parameters for the given path keyed by their attr paths. Eg:

{
    ('members', 'value', None):  "2819c223-7f76-453a-919d-413861904646",
}
scim2_filter_parser.attr_paths.main(argv=None)

Main program. Used for testing.