1 | |
---|
2 | # acme_rockets_rt0_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 | acme=`creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
13 | coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem` |
---|
14 | |
---|
15 | preferred_customer="[keyid:$acme].role:preferred_customer" |
---|
16 | buy_rockets="[keyid:$acme].role:buy_rockets" |
---|
17 | coyote_prin="[keyid:$coyote]" |
---|
18 | friend="[keyid:$acme].role:friend" |
---|
19 | acme_prin="[keyid:$acme]" |
---|
20 | |
---|
21 | ## dump all credentials |
---|
22 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
23 | |
---|
24 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] |
---|
25 | #isMember(pCoyote, role(pAcme,preferred_customer), C). |
---|
26 | echo " " |
---|
27 | echo "===good============ Acme.preferred_customer <- Coyote" |
---|
28 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
29 | --role "$preferred_customer" --principal "$coyote_prin" |
---|
30 | |
---|
31 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote] |
---|
32 | #isMember(pCoyote, role(pAcme,buy_rockets), C). |
---|
33 | echo " " |
---|
34 | echo "===good=============== Acme.buy_rockets <- Coyote" |
---|
35 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
36 | --role "$buy_rockets" --principal "$coyote_prin" |
---|
37 | |
---|
38 | ## this is not suppose to work |
---|
39 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer |
---|
40 | echo " " |
---|
41 | echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer" |
---|
42 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
43 | --role "$buy_rockets" --principal "$preferred_customer" |
---|
44 | |
---|
45 | #[keyid:Coyote].role:friend <-?- [keyid:Acme] |
---|
46 | #isMember(pAcme, role(pCoyote,friend), C). |
---|
47 | echo " " |
---|
48 | echo "===bad=============== Coyote.friend <- Acme" |
---|
49 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
50 | --role "$friend" --principal "$acme_prin" |
---|
51 | |
---|