[718ad924] | 1 | |
---|
[9502c50] | 2 | # acme_rockets_rt0_typed |
---|
[da5afdf] | 3 | |
---|
[c469edf] | 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 |
---|
[34ea038] | 10 | keyloc=$pwd |
---|
[718ad924] | 11 | |
---|
| 12 | acme=`creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
| 13 | coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem` |
---|
| 14 | |
---|
[da5afdf] | 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 | |
---|
[9502c50] | 24 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] |
---|
[718ad924] | 25 | #isMember(pCoyote, role(pAcme,preferred_customer), C). |
---|
| 26 | echo " " |
---|
[9502c50] | 27 | echo "===good============ Acme.preferred_customer <- Coyote" |
---|
[da5afdf] | 28 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 29 | --role "$preferred_customer" --principal "$coyote_prin" |
---|
[718ad924] | 30 | |
---|
[9502c50] | 31 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote] |
---|
[718ad924] | 32 | #isMember(pCoyote, role(pAcme,buy_rockets), C). |
---|
| 33 | echo " " |
---|
[9502c50] | 34 | echo "===good=============== Acme.buy_rockets <- Coyote" |
---|
[da5afdf] | 35 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 36 | --role "$buy_rockets" --principal "$coyote_prin" |
---|
[718ad924] | 37 | |
---|
| 38 | ## this is not suppose to work |
---|
[9502c50] | 39 | #[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer |
---|
[718ad924] | 40 | echo " " |
---|
[9502c50] | 41 | echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer" |
---|
[da5afdf] | 42 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 43 | --role "$buy_rockets" --principal "$preferred_customer" |
---|
[718ad924] | 44 | |
---|
[9502c50] | 45 | #[keyid:Coyote].role:friend <-?- [keyid:Acme] |
---|
[718ad924] | 46 | #isMember(pAcme, role(pCoyote,friend), C). |
---|
| 47 | echo " " |
---|
[9502c50] | 48 | echo "===bad=============== Coyote.friend <- Acme" |
---|
[da5afdf] | 49 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 50 | --role "$friend" --principal "$acme_prin" |
---|
[718ad924] | 51 | |
---|