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