generate - Generate a set of selector expressions for keys and values of a Subject Context
Synopsis
otdfctl dev selectors generate [flags]
Description
Take in an Entity Representation as a JWT or JSON object, such as that provided by an Identity Provider (idP), LDAP, or OIDC Access Token JWT, and generate sample selectors employing flattening syntax to utilize within within Subject Condition Sets that resolve an external Subject Context into mapped Attribute Values.
Flattening-syntax
The platform maintains a very simple flattening library such that the below structure flattens into the key/value pairs beneath.
Subject input (--subject
):
{
"key": "abc",
"something": {
"nested": "nested_value",
"list": ["item_1", "item_2"]
}
}
Generated Selectors:
Selector | Value | Significance |
---|---|---|
".key" | "abc" | specified field |
".something.nested" | "nested_value" | nested field |
".something.list[0]" | "item_1" | first index specifically |
".something.list[]" | "item_1" | any index in the list |
".something.list[1]" | "item_2" | second index specifically |
".something.list[]" | "item_2" | any index in the list |
Options
-s
,--subject <subject>
- A Subject Context string (JSON or JWT, default JSON) (required:
false
)
Aliases
gen