1 | |
---|
2 | # experiment_create_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 | alice=`creddy --keyid --cert $keyloc/Alice_ID.pem` |
---|
14 | bob=`creddy --keyid --cert $keyloc/Bob_ID.pem` |
---|
15 | globotron=`creddy --keyid --cert $keyloc/Globotron_ID.pem` |
---|
16 | |
---|
17 | glob_admin="[keyid:$globotron].role:admin" |
---|
18 | alice_prin="[keyid:$alice]" |
---|
19 | bob_prin="[keyid:$bob]" |
---|
20 | experiment_create="[keyid:$acme].role:experiment_create" |
---|
21 | |
---|
22 | ## dump all credentials |
---|
23 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
24 | |
---|
25 | #[keyid:Globotron].role:admin <-?- [keyid:Alice] |
---|
26 | #isMember(pAlice, role(pGlobotron,admin), C). |
---|
27 | echo " " |
---|
28 | echo "===good=============== Globotron.admin <- Alice" |
---|
29 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
30 | --role "$glob_admin" --principal "$alice_prin" |
---|
31 | |
---|
32 | #[keyid:Globotron].role:admin <-?- [keyid:Bob] |
---|
33 | #isMember(pBob, role(pGlobotron,admin), C). |
---|
34 | echo " " |
---|
35 | echo "===bad=============== Globotron.admin <- Bob" |
---|
36 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
37 | --role "$glob_admin" --principal "$bob_prin" |
---|
38 | |
---|
39 | #[keyid:Acme].role:experiment_create <-?- [keyid:Bob] |
---|
40 | #isMember(pBob, role(pAcme,experiment_create), C). |
---|
41 | echo " " |
---|
42 | echo "===good=============== Acme.experiment_create <- Bob" |
---|
43 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
44 | --role "$experiment_create" --principal "$bob_prin" |
---|
45 | |
---|
46 | |
---|