1 | |
---|
2 | # acme_friend_rt1_typed |
---|
3 | |
---|
4 | pwd=`pwd` |
---|
5 | |
---|
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 |
---|
11 | keyloc=$pwd |
---|
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 | |
---|
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 |
---|
26 | |
---|
27 | #[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Coyote] |
---|
28 | echo " " |
---|
29 | echo "===bad============ Acme.friendOf(Roadrunner) <- Coyote" |
---|
30 | $eloc/abac_prover_yap --keystore $keyloc --role "$friendof_roadrunner" --principal "$coyote_prin" |
---|
31 | |
---|
32 | #[keyid:Acme].role:friendof([keyid:Roadrunner]) <-?- [keyid:Jackrabbit] |
---|
33 | echo " " |
---|
34 | echo "===good============ Acme.friendOf(Roadrunner) <- Jackrabbit" |
---|
35 | $eloc/abac_prover_yap --keystore $keyloc --role "$friendof_roadrunner" --principal "$jackrabbit_prin" |
---|
36 | |
---|
37 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Jackrabbit] |
---|
38 | echo " " |
---|
39 | echo "===good============ Acme.preferred_customer <- Jackrabbit" |
---|
40 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$jackrabbit_prin" |
---|
41 | |
---|
42 | #[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote] |
---|
43 | echo " " |
---|
44 | echo "===good============ Acme.preferred_customer <- Coyote" |
---|
45 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$coyote_prin" |
---|
46 | |
---|
47 | #[keyid:Acme].role:preferred_customer <-?- [keyid:badCoyote] |
---|
48 | echo " " |
---|
49 | echo "===bad============ Acme.preferred_customer <- badCoyote" |
---|
50 | $eloc/abac_prover_yap --keystore $keyloc --role "$preferred_customer" --principal "$badcoyote_prin" |
---|
51 | |
---|
52 | |
---|