[718ad924] | 1 | |
---|
[9502c50] | 2 | # experiment_create_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 |
---|
[c469edf] | 10 | keyloc=$pwd |
---|
[718ad924] | 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 | |
---|
[da5afdf] | 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 | |
---|
[9502c50] | 25 | #[keyid:Globotron].role:admin <-?- [keyid:Alice] |
---|
[718ad924] | 26 | #isMember(pAlice, role(pGlobotron,admin), C). |
---|
| 27 | echo " " |
---|
[9502c50] | 28 | echo "===good=============== Globotron.admin <- Alice" |
---|
[da5afdf] | 29 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 30 | --role "$glob_admin" --principal "$alice_prin" |
---|
[718ad924] | 31 | |
---|
[9502c50] | 32 | #[keyid:Globotron].role:admin <-?- [keyid:Bob] |
---|
[718ad924] | 33 | #isMember(pBob, role(pGlobotron,admin), C). |
---|
| 34 | echo " " |
---|
[9502c50] | 35 | echo "===bad=============== Globotron.admin <- Bob" |
---|
[da5afdf] | 36 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 37 | --role "$glob_admin" --principal "$bob_prin" |
---|
[718ad924] | 38 | |
---|
[9502c50] | 39 | #[keyid:Acme].role:experiment_create <-?- [keyid:Bob] |
---|
[718ad924] | 40 | #isMember(pBob, role(pAcme,experiment_create), C). |
---|
| 41 | echo " " |
---|
[9502c50] | 42 | echo "===good=============== Acme.experiment_create <- Bob" |
---|
[da5afdf] | 43 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 44 | --role "$experiment_create" --principal "$bob_prin" |
---|
[718ad924] | 45 | |
---|
| 46 | |
---|