[da5afdf] | 1 | |
---|
[9502c50] | 2 | # acme_friend_rt1_typed |
---|
[da5afdf] | 3 | |
---|
[c469edf] | 4 | pwd=`pwd` |
---|
| 5 | |
---|
[08b8da7] | 6 | eloc=`which abac_prover_yap | sed 's/\/abac_prover_yap//'` |
---|
| 7 | if [ "$eloc" = "" ]; then |
---|
| 8 | echo "ERROR: abac_prover_yap is not in the search path!!!" |
---|
| 9 | exit 1 |
---|
| 10 | fi |
---|
[c469edf] | 11 | keyloc=$pwd |
---|
[718ad924] | 12 | |
---|
| 13 | roadrunner=`creddy --keyid --cert $keyloc/Roadrunner_ID.pem` |
---|
| 14 | acme=`creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
| 15 | coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem` |
---|
| 16 | jackrabbit=`creddy --keyid --cert $keyloc/Jackrabbit_ID.pem` |
---|
| 17 | |
---|
[da5afdf] | 18 | friendof_roadrunner="[keyid:$acme].role:friendOf([keyid:$roadrunner])" |
---|
| 19 | coyote_prin="[keyid:$coyote]" |
---|
| 20 | badcoyote_prin="[keyid:bad]" |
---|
| 21 | preferred_customer="[keyid:$acme].role:preferred_customer" |
---|
| 22 | jackrabbit_prin="[keyid:$jackrabbit]" |
---|
| 23 | |
---|
| 24 | ## dump all credentials |
---|
| 25 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
[718ad924] | 26 | |
---|
[9502c50] | 27 | #[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Coyote] |
---|
[da5afdf] | 28 | echo " " |
---|
[9502c50] | 29 | echo "===bad============ Acme.friendOf(Roadrunner) <- Coyote" |
---|
[da5afdf] | 30 | $eloc/abac_prover_yap --keystore $keyloc --role "$friendof_roadrunner" --principal "$coyote_prin" |
---|
| 31 | |
---|
[9502c50] | 32 | #[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Jackrabbit] |
---|
[da5afdf] | 33 | echo " " |
---|
[9502c50] | 34 | echo "===good============ Acme.friendOf(Roadrunner) <- Jackrabbit" |
---|
[da5afdf] | 35 | $eloc/abac_prover_yap --keystore $keyloc --role "$friendof_roadrunner" --principal "$jackrabbit_prin" |
---|
[718ad924] | 36 | |
---|
[9502c50] | 37 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Jackrabbit] |
---|
[da5afdf] | 38 | echo " " |
---|
[9502c50] | 39 | echo "===good============ Acme.preferred_customer <- Jackrabbit" |
---|
[da5afdf] | 40 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$jackrabbit_prin" |
---|
[718ad924] | 41 | |
---|
[9502c50] | 42 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] |
---|
[da5afdf] | 43 | echo " " |
---|
[9502c50] | 44 | echo "===good============ Acme.preferred_customer <- Coyote" |
---|
[da5afdf] | 45 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$coyote_prin" |
---|
[718ad924] | 46 | |
---|
[9502c50] | 47 | #[keyid:Acme].role:preferred_customer <-?- [keyid:badCoyote] |
---|
[da5afdf] | 48 | echo " " |
---|
[9502c50] | 49 | echo "===bad============ Acme.preferred_customer <- badCoyote" |
---|
[da5afdf] | 50 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$badcoyote_prin" |
---|
[718ad924] | 51 | |
---|
| 52 | |
---|