1 | |
---|
2 | # number of credentials, 3 + 6 + 3 x #VAL# |
---|
3 | |
---|
4 | # fruits_rt2_typed |
---|
5 | |
---|
6 | keyloc=`pwd` |
---|
7 | eloc=`which abac_prover_yap | sed 's/\/abac_prover_yap//'` |
---|
8 | if [ "$eloc" = "" ]; then |
---|
9 | echo "ERROR: abac_prover_yap is not in the search path!!!" |
---|
10 | exit 1 |
---|
11 | fi |
---|
12 | |
---|
13 | ralphs=`creddy --keyid --cert $keyloc/Ralphs_ID.pem` |
---|
14 | bob=`creddy --keyid --cert $keyloc/Bob_ID.pem` |
---|
15 | mary=`creddy --keyid --cert $keyloc/Mary_ID.pem` |
---|
16 | |
---|
17 | mary_what2eat="[keyid:$mary].oset:what2eat" |
---|
18 | bob_what2eat="[keyid:$bob].oset:what2eat" |
---|
19 | ralphs_apple="[keyid:$ralphs].oset:fruitprice([float:1.50])" |
---|
20 | |
---|
21 | ## dump all credentials |
---|
22 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
23 | |
---|
24 | # [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes) |
---|
25 | echo " " |
---|
26 | echo "===good============ mary.what2eat <- navel orange" |
---|
27 | $eloc/abac_prover_yap --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']" |
---|
28 | |
---|
29 | # [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes) |
---|
30 | echo " " |
---|
31 | echo "===good============ mary.what2eat <- kiwi" |
---|
32 | $eloc/abac_prover_yap --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']" |
---|
33 | |
---|
34 | # [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no) |
---|
35 | echo " " |
---|
36 | echo "===bad============ bob.what2eat <- navel orange" |
---|
37 | $eloc/abac_prover_yap --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']" |
---|
38 | |
---|
39 | # [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes) |
---|
40 | echo " " |
---|
41 | echo "===good============ ralphs.fruitprice(1.50) <- apple" |
---|
42 | $eloc/abac_prover_yap --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']" |
---|
43 | |
---|
44 | # [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no) |
---|
45 | echo " " |
---|
46 | echo "===bad============ ralphs.fruitprice(1.50) <- green apple" |
---|
47 | $eloc/abac_prover_yap --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']" |
---|
48 | |
---|
49 | |
---|