-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from wistefan/ngsi-ld
tmf
- Loading branch information
Showing
9 changed files
with
78 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package tmf.leftOperand | ||
|
||
import rego.v1 | ||
|
||
## tmf:lifecycleStatus | ||
# return the lifeCycleStatus of a given entity | ||
life_cycle_status(entity) := entity.lifeCycleStatus | ||
|
||
## tmf:resource | ||
# retrieves the type of the resource from the path | ||
resource_type(http_part) := resource if { | ||
path_without_query := split(http_part.path, "?")[0] | ||
path_elements := split(path_without_query, "/") | ||
# reverse the path to get the potential id element first | ||
reversed := array.reverse(path_elements) | ||
# remove the (potential) id element from the path array | ||
non_id_parts := [path_element | some path_element in reversed; not contains(path_element, "ngsi-ld")] | ||
# after removal of the id, the resource is the first one to be retrieved | ||
resource = non_id_parts[0] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
package vc.assignee | ||
|
||
import rego.v1 | ||
|
||
## odrl:any | ||
# allows for any user | ||
is_any := true |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
] | ||
}, | ||
"odrl:assignee": { | ||
"@id": "odrl:any" | ||
"@id": "vc:any" | ||
}, | ||
"odrl:action": { | ||
"@id": "dome-op:read" | ||
|