Skip to content
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
815c5a4
feat(main): add docs for actions CRUD
jakedoublev Apr 10, 2025
cb7e2f0
wip
jakedoublev Apr 10, 2025
9a29312
Merge branch 'main' into feat/actions-support
jakedoublev Apr 21, 2025
8cb483b
WIP
jakedoublev Apr 21, 2025
a850000
improve docs around valid inputs when creating policy objects
jakedoublev Apr 22, 2025
9019dd6
handler for actions
jakedoublev Apr 22, 2025
a1a4f50
commands for policy actions
jakedoublev Apr 23, 2025
0687818
improve output table
jakedoublev Apr 23, 2025
7188107
error fixes
jakedoublev Apr 23, 2025
7b90e48
bats tests
jakedoublev Apr 23, 2025
31b8bb8
bump platform deps with proto/sdk changes
jakedoublev Apr 24, 2025
bbff940
fix typos
jakedoublev Apr 24, 2025
71d3f6a
test and lint fixes
jakedoublev Apr 24, 2025
225b591
lint fix
jakedoublev Apr 24, 2025
2e8c1ae
actions tests
jakedoublev Apr 24, 2025
f7e9289
fix
jakedoublev Apr 24, 2025
39956c1
fix
jakedoublev Apr 24, 2025
1c9a93d
fix
jakedoublev Apr 24, 2025
040350e
wip
jakedoublev Apr 24, 2025
974ea36
add actions info to attribute definition docs
jakedoublev Apr 24, 2025
b61ca98
Merge branch 'main' into feat/actions-sm
jakedoublev Apr 24, 2025
3d9d6c3
update subject mapping actions commands
jakedoublev Apr 24, 2025
a685b26
do not skip sm tests after these changes
jakedoublev Apr 24, 2025
bb383b7
fix update man doc
jakedoublev Apr 24, 2025
a64e870
sm e2e fixes
jakedoublev Apr 24, 2025
654c452
fixes
jakedoublev Apr 24, 2025
ca61175
context tech debt
jakedoublev Apr 25, 2025
3abc57b
more thorough e2e tests
jakedoublev Apr 25, 2025
f8333b4
lint fix
jakedoublev Apr 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions docs/man/policy/attributes/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,19 @@ and may contain hyphens and underscores between other alphanumeric characters.
#### ANY_OF

If an Attribute is defined with logical rule `ANY_OF`, an Entity who is mapped to `any` of the associated Values of the Attribute
on TDF'd Resource Data will be Entitled.
on TDF'd Resource Data will be Entitled to take the actions in the mapping.

#### ALL_OF

If an Attribute is defined with logical rule `ALL_OF`, an Entity must be mapped to `all` of the associated Values of the Attribute
on TDF'd Resource Data to be Entitled.
on TDF'd Resource Data to be Entitled to take the actions in the mapping.

### HIERARCHY

If an Attribute is defined with logical rule `HIERARCHY`, an Entity must be mapped to the same level Value or a level above in hierarchy
compared to a given Value on TDF'd Resource Data. Hierarchical values are considered highest at index 0 and lowest at the last index.
compared to a given Value on TDF'd Resource Data. Hierarchical values are considered highest at index 0 and lowest at the last index. Actions
propagate down through the hierarchy, so a mapping of a `read` action on the highest level Value on the Attribute will entitle the action
to each hierarchically lower value, and so on.

For more general information about attributes, see the `attributes` subcommand.

Expand Down
5 changes: 3 additions & 2 deletions docs/man/policy/subject-mappings/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ command:
- subject-mapping
---

As data is bound to fully qualified Attribute Values when encrypted within a TDF, Entities are entitled to Attribute Values through a mechanism called Subject Mappings.
As data is bound to fully qualified Attribute Values when encrypted within a TDF, Entities are entitled to take actions on
resources containing Attribute Values through a mechanism called Subject Mappings.

A Subject Mapping (SM) is the relation of a Subject Condition Set (SCS, see `subject-condition-sets` command)
to an Attribute Value to determine a Subject's Entitlement to an Attribute Value.
to an Attribute Value to determine a Subject's Entitlement to take various actions on an Attribute Value.

Entities (Subjects, Users, Machines, etc.) are defined by a representation (Entity Representation) of their identity from an identity provider (idP).
The OpenTDF Platform is not itself an idP, and it utilizes the OpenID Connect (OIDC) protocol as well as idP pluggability to rely upon an Entity store
Expand Down
44 changes: 18 additions & 26 deletions docs/man/policy/subject-mappings/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,55 +8,47 @@ command:
- c
flags:
- name: attribute-value-id
description: The ID of the attribute value to map to a subject set
description: The ID of the attribute value to map to a subject condition set
shorthand: a
required: true
default: ''
- name: action-standard
description: The standard action to map to a subject set
enum:
- DECRYPT
- TRANSMIT
shorthand: s
required: true
default: ''
- name: action-custom
description: The custom action to map to a subject set
shorthand: c
required: false
default: ''
- name: action
description: Each 'id' or 'name' of an Action to be entitled (i.e. 'create', 'read', 'update', 'delete')
- name: subject-condition-set-id
description: Known preexisting Subject Condition Set Id
required: true
default: ''
- name: subject-condition-set-new
description: JSON array of Subject Sets to create a new Subject Condition Set associated with the created Subject Mapping
required: false
default: ''
- name: label
description: "Optional metadata 'labels' in the format: key=value"
shorthand: l
default: ''
- name: action-standard
description: Deprecated. Migrated to '--action'.
shorthand: s
- name: action-custom
description: Deprecated. Migrated to '--action'.
shorthand: c
---

The possible values for standard actions are DECRYPT and TRANSMIT.
Create a Subject Mapping to entitle an entity (via existing or new Subject Condition Set) to action(s) on an Attribute Value.

Subject Mappings may entitle actions with standard names ('create', 'read', 'update', 'delete'), custom names, or by their
stored 'id' within policy.

Create a Subject Mapping to entitle an entity (via existing or new Subject Condition Set) to an Attribute Value.
For more information about actions, see the `actions` subcommand.

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

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

## Examples

Create a subject mapping linking to an existing subject condition set:
Create a subject mapping for a 'read' action linking to an existing subject condition set:
```shell
otdfctl policy subject-mapping create --attribute-value-id 891cfe85-b381-4f85-9699-5f7dbfe2a9ab --action-standard DECRYPT --subject-condition-set-id 8dc98f65-5f0a-4444-bfd1-6a818dc7b447
otdfctl policy subject-mapping create --attribute-value-id 891cfe85-b381-4f85-9699-5f7dbfe2a9ab --action read --subject-condition-set-id 8dc98f65-5f0a-4444-bfd1-6a818dc7b447
```

Or you can create a mapping that linked to a new subject condition set:
Or you can create a mapping for 'read' or 'create' linking to a new subject condition set:
```shell
otdfctl policy subject-mapping create --attribute-value-id 891cfe85-b381-4f85-9699-5f7dbfe2a9ab --action-standard DECRYPT --subject-condition-set-new '[
otdfctl policy subject-mapping create --attribute-value-id 891cfe85-b381-4f85-9699-5f7dbfe2a9ab --action create --action update --subject-condition-set-new '[
{
"condition_groups": [
{
Expand Down