Skip to content

Commit

Permalink
fix: extend acs-client to validate multiple matching entities and ins…
Browse files Browse the repository at this point in the history
…tances for a given subject
  • Loading branch information
Arun-KumarH committed Apr 21, 2024
1 parent 8cec7fb commit 1c27d84
Show file tree
Hide file tree
Showing 7 changed files with 121 additions and 94 deletions.
11 changes: 6 additions & 5 deletions filter_ownership.aql
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ let meta = node.meta
let owner = meta.owners
let found = (
for o in owner
filter o.id == "urn:restorecommerce:acs:names:ownerIndicatoryEntity" && o.value == @entity
let nestedAttributes = o.attributes
for ownerInst in nestedAttributes
filter ownerInst.id == "urn:restorecommerce:acs:names:ownerInstance" && ownerInst.value in @instance
return true
for arg in @customArguments
filter o.id == "urn:restorecommerce:acs:names:ownerIndicatoryEntity" && o.value == arg.entity
let nestedAttributes = o.attributes
for ownerInst in nestedAttributes
filter ownerInst.id == "urn:restorecommerce:acs:names:ownerInstance" && ownerInst.value in arg.instance
return true
)
filter true in found
5 changes: 3 additions & 2 deletions filter_role_association.aql
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ let foundAssoc = (
let attributes = roleAssoc.attributes
let inAttributes = (
for a in attributes
filter a.id == "urn:restorecommerce:acs:names:roleScopingEntity" && a.value == @scopingEntity
for arg in @customArguments
filter a.id == "urn:restorecommerce:acs:names:roleScopingEntity" && a.value == arg.scopingEntity
let nestedAttributes = a.attributes
for scopInst in nestedAttributes
filter scopInst.id == "urn:restorecommerce:acs:names:roleScopingInstance" && scopInst.value in @scopingInstances
filter scopInst.id == "urn:restorecommerce:acs:names:roleScopingInstance" && scopInst.value in arg.scopingInstances
limit 1
return true
)
Expand Down
146 changes: 74 additions & 72 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 1c27d84

Please sign in to comment.