Skip to content

Commit aaa6b76

Browse files
author
Gerald Baulig
committed
fix(custom_queries): add custom queries
1 parent 359a017 commit aaa6b76

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

Dockerfile

+1
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ ARG APP_HOME=/home/node/srv
2222
WORKDIR $APP_HOME
2323

2424
COPY --chown=node:node ./cfg $APP_HOME/cfg
25+
COPY --chown=node:node ./queries $APP_HOME/queries
2526
COPY --chown=node:node --from=build $APP_HOME/lib $APP_HOME/lib
2627

2728
EXPOSE 50051

cfg/config.json

+7-8
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@
2323
"fulfillment",
2424
"fulfillmentCourier",
2525
"fulfillmentProduct"
26+
],
27+
"customQueries": [
28+
{
29+
"path": "queries/filter_ownership.aql",
30+
"name": "filterByOwnership",
31+
"type": "filter"
32+
}
2633
]
2734
}
2835
},
@@ -263,14 +270,6 @@
263270
"enabled": true,
264271
"enforce": true,
265272
"database": "arangoDB",
266-
"client": {
267-
"acs-srv": {
268-
"address": "localhost:50061"
269-
},
270-
"user": {
271-
"address": "localhost:50051"
272-
}
273-
},
274273
"urns": {
275274
"entity": "urn:restorecommerce:acs:names:model:entity",
276275
"user": "urn:restorecommerce:acs:model:user.User",

cfg/config_production.json

-6
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,6 @@
6363
}
6464
},
6565
"authorization": {
66-
"acs-srv": {
67-
"address": "access-control-srv:50051"
68-
},
69-
"user": {
70-
"address": "identity-srv:50051"
71-
},
7266
"cache": {
7367
"url": "redis://redis:6379"
7468
}

queries/filter_ownership.aql

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
let found = (
2+
for o in node.meta.owners
3+
filter o.id == "urn:restorecommerce:acs:names:ownerIndicatoryEntity"
4+
for arg in @customArguments
5+
filter o.value == arg.entity
6+
for ownerInst in o.attributes
7+
filter ownerInst.id == "urn:restorecommerce:acs:names:ownerInstance"
8+
filter ownerInst.value in arg.instance
9+
return true
10+
)
11+
filter true in found

0 commit comments

Comments
 (0)