[9502c50] | 1 | |
---|
| 2 | # fruits_rt2_typed |
---|
[c586a3c] | 3 | |
---|
| 4 | pwd=`pwd` |
---|
[08b8da7] | 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 |
---|
[c586a3c] | 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 | |
---|
[36b100a] | 23 | # [keyid:mary].oset:what2eat <-?- [string:'navel orange'] (yes) |
---|
| 24 | echo " " |
---|
[9502c50] | 25 | echo "===good============ mary.what2eat <- navel orange" |
---|
[36b100a] | 26 | $eloc/abac_prover_yap --keystore $keyloc --oset "$mary_what2eat" --object "[string:'navel orange']" |
---|
[c586a3c] | 27 | |
---|
[d5bbd3e] | 28 | # [keyid:mary].oset:what2eat <-?- [string:'kiwi'] (yes) |
---|
| 29 | echo " " |
---|
[9502c50] | 30 | echo "===good============ mary.what2eat <- kiwi" |
---|
[d5bbd3e] | 31 | $eloc/abac_prover_yap --keystore $keyloc --oset "$mary_what2eat" --object "[string:'kiwi']" |
---|
| 32 | |
---|
[36b100a] | 33 | # [keyid:bob].oset:what2eat <-?- [string:'navel orange'] (no) |
---|
| 34 | echo " " |
---|
[9502c50] | 35 | echo "===bad============ bob.what2eat <- navel orange" |
---|
[36b100a] | 36 | $eloc/abac_prover_yap --keystore $keyloc --oset "$bob_what2eat" --object "[string:'navel orange']" |
---|
[c586a3c] | 37 | |
---|
| 38 | # [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'apple'] (yes) |
---|
[36b100a] | 39 | echo " " |
---|
[9502c50] | 40 | echo "===good============ ralphs.fruitprice(1.50) <- apple" |
---|
[c586a3c] | 41 | $eloc/abac_prover_yap --keystore $keyloc --oset "$ralphs_apple" --object "[string:'apple']" |
---|
| 42 | |
---|
[36b100a] | 43 | # [keyid:$ralphs].oset:fruitprice([float:1.50]) <-?- [string:'green apple'] (no) |
---|
| 44 | echo " " |
---|
[9502c50] | 45 | echo "===bad============ ralphs.fruitprice(1.50) <- green apple" |
---|
[36b100a] | 46 | $eloc/abac_prover_yap --keystore $keyloc --oset "$ralphs_apple" --object "[string:'green apple']" |
---|
| 47 | |
---|
[c586a3c] | 48 | |
---|