Skip to content

Commit

Permalink
scs examples
Browse files Browse the repository at this point in the history
  • Loading branch information
elizabethhealy committed Dec 18, 2024
1 parent 483c02f commit f05b702
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 0 deletions.
59 changes: 59 additions & 0 deletions docs/man/policy/subject-condition-sets/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,3 +94,62 @@ the condition set would not resolve to true, and the Subject would not be found
to the Attribute Value applicable to this Subject Condition Set via Subject Mapping between.

For more information about subject condition sets, see the `subject-condition-sets` subcommand.

## Examples

The following subject condition set would resolve to true if the field at `.example.field.one` is
"myvalue" or "myothervalue", or the field at `.example.field.two` is not equal to "notpresentvalue".

Check failure on line 101 in docs/man/policy/subject-condition-sets/create.md

View workflow job for this annotation

GitHub Actions / spellcheck

Misspelled word

Misspelled word "myvalue". Suggested alternatives: "my value", "my-value", "value" If you want to ignore this message, add myvalue to the ignore file at ./.github/spellcheck.ignore

Check failure on line 101 in docs/man/policy/subject-condition-sets/create.md

View workflow job for this annotation

GitHub Actions / spellcheck

Misspelled word

Misspelled word "myothervalue". Suggested alternatives: "hydrothermal" If you want to ignore this message, add myothervalue to the ignore file at ./.github/spellcheck.ignore

Check failure on line 101 in docs/man/policy/subject-condition-sets/create.md

View workflow job for this annotation

GitHub Actions / spellcheck

Misspelled word

Misspelled word "notpresentvalue". Suggested alternatives: "nonrepresentational" If you want to ignore this message, add notpresentvalue to the ignore file at ./.github/spellcheck.ignore
```shell
otdfctl policy subject-condition-set create --subject-sets '[
{
"condition_groups": [
{
"conditions": [
{
"operator": 1,
"subject_external_values": ["myvalue", "myothervalue"],
"subject_external_selector_value": ".example.field.one"
},
{
"operator": 2,
"subject_external_values": ["notpresentvalue"],
"subject_external_selector_value": ".example.field.two"
}
],
"boolean_operator": 2
}
]
}
]'
```

```shell
SUCCESS Created subject-condition-sets: bfade235-509a-4a6f-886a-812005c01db5
╭─────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Property │Value │
├─────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│Id │bfade235-509a-4a6f-886a-812005c01db5 │
│SubjectSets │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":".example.field.one","operator":"SUBJECT_MAPPING_OPERATOR_ENUM_IN","subject…│
│Created At │Wed Dec 18 06:44:39 UTC 2024 │
│Updated At │Wed Dec 18 06:44:39 UTC 2024 │
╰─────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NOTE Use 'otdfctl policy subject-condition-sets get --id=bfade235-509a-4a6f-886a-812005c01db5 --json' to see all properties
```
You can perform the same action with the input contained in a file:
```shell
otdfctl policy subject-condition-set create --subject-sets-file-json scs.json
```
```shell
SUCCESS Created subject-condition-sets: bfade235-509a-4a6f-886a-812005c01db5
╭─────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Property │Value │
├─────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│Id │bfade235-509a-4a6f-886a-812005c01db5 │
│SubjectSets │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":".example.field.one","operator":"SUBJECT_MAPPING_OPERATOR_ENUM_IN","subject…│
│Created At │Wed Dec 18 06:44:39 UTC 2024 │
│Updated At │Wed Dec 18 06:44:39 UTC 2024 │
╰─────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NOTE Use 'otdfctl policy subject-condition-sets get --id=bfade235-509a-4a6f-886a-812005c01db5 --json' to see all properties
```
19 changes: 19 additions & 0 deletions docs/man/policy/subject-condition-sets/delete.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,22 @@ command:
---

For more information about subject condition sets, see the `subject-condition-sets` subcommand.

## Example

```shell
otdfctl policy subject-condition-sets delete --id=bfade235-509a-4a6f-886a-812005c01db5
```

```shell
SUCCESS Deleted subject-condition-sets: bfade235-509a-4a6f-886a-812005c01db5
╭─────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Property │Value │
├─────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│Id │bfade235-509a-4a6f-886a-812005c01db5 │
│SubjectSets │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":".example.field.one","operator":"SUBJECT_MAPPING_OPERATOR_ENUM_IN","subject…│
│Created At │Wed Dec 18 06:44:39 UTC 2024 │
│Updated At │Wed Dec 18 06:54:28 UTC 2024 │
╰─────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NOTE Use 'otdfctl policy subject-condition-sets list --json' to see all properties
```
19 changes: 19 additions & 0 deletions docs/man/policy/subject-condition-sets/get.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,22 @@ command:
---

For more information about subject condition sets, see the `subject-condition-sets` subcommand.

## Example

```shell
otdfctl policy subject-condition-sets get --id=bfade235-509a-4a6f-886a-812005c01db5
```

```shell
SUCCESS Found subject-condition-sets: bfade235-509a-4a6f-886a-812005c01db5
╭─────────────────────────────────────────────────────────────────────────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│Property │Value │
├─────────────────────────────────────────────────────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│Id │bfade235-509a-4a6f-886a-812005c01db5 │
│SubjectSets │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":".example.field.one","operator":"SUBJECT_MAPPING_OPERATOR_ENUM_IN","subject…│
│Created At │Wed Dec 18 06:44:39 UTC 2024 │
│Updated At │Wed Dec 18 06:44:39 UTC 2024 │
╰─────────────────────────────────────────────────────────────────────────┴────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
NOTE Use 'otdfctl policy subject-condition-sets get --id=bfade235-509a-4a6f-886a-812005c01db5 --json' to see all properties
```
18 changes: 18 additions & 0 deletions docs/man/policy/subject-condition-sets/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,21 @@ command:
---

For more information about subject condition sets, see the `subject-condition-sets` subcommand.

## Example

```shell
otdfctl policy subject-condition-set list
```

```shell
SUCCESS Found subject-condition-sets list

╭──────────────────────────────────────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────┬──────────────────┬──────────────────┬───────────────────────╮
│ID │SubjectSets │Labels │Created At │Updated At │
├──────────────────────────────────────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────┼──────────────────┼──────────────────┼───────────────────────┤
│8b80eb7c-cecb-44d4-91a7-f14ada74d4ce │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":…│[] │Mon Dec 16 16:00:…│Mon Dec 16 16:00:33 UT…│
│bfade235-509a-4a6f-886a-812005c01db5 │[{"conditionGroups":[{"conditions":[{"subjectExternalSelectorValue":…│[] │Wed Dec 18 06:44:…│Wed Dec 18 06:44:39 UT…│
╰──────────────────────────────────────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────┴──────────────────┴──────────────────┴───────────────────────╯
NOTE Use 'otdfctl policy subject-condition-sets get --id=<id> --json' to see all properties
```
Loading

0 comments on commit f05b702

Please sign in to comment.