[718ad924] | 1 | |
---|
[9502c50] | 2 | # experiment_create_rt0_typed |
---|
[da5afdf] | 3 | |
---|
[c469edf] | 4 | pwd=`pwd` |
---|
| 5 | |
---|
[5110d42] | 6 | eloc=${ABAC_PROVER_PATH} |
---|
[c469edf] | 7 | keyloc=$pwd |
---|
[718ad924] | 8 | |
---|
| 9 | acme=`creddy --keyid --cert $keyloc/Acme_ID.pem` |
---|
| 10 | alice=`creddy --keyid --cert $keyloc/Alice_ID.pem` |
---|
| 11 | bob=`creddy --keyid --cert $keyloc/Bob_ID.pem` |
---|
| 12 | globotron=`creddy --keyid --cert $keyloc/Globotron_ID.pem` |
---|
| 13 | |
---|
[da5afdf] | 14 | glob_admin="[keyid:$globotron].role:admin" |
---|
| 15 | alice_prin="[keyid:$alice]" |
---|
| 16 | bob_prin="[keyid:$bob]" |
---|
| 17 | experiment_create="[keyid:$acme].role:experiment_create" |
---|
| 18 | |
---|
| 19 | ## dump all credentials |
---|
| 20 | $eloc/abac_prover_yap --keystore $keyloc --dump creds_dump |
---|
| 21 | |
---|
[9502c50] | 22 | #[keyid:Globotron].role:admin <-?- [keyid:Alice] |
---|
[718ad924] | 23 | #isMember(pAlice, role(pGlobotron,admin), C). |
---|
| 24 | echo " " |
---|
[9502c50] | 25 | echo "===good=============== Globotron.admin <- Alice" |
---|
[da5afdf] | 26 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 27 | --role "$glob_admin" --principal "$alice_prin" |
---|
[718ad924] | 28 | |
---|
[9502c50] | 29 | #[keyid:Globotron].role:admin <-?- [keyid:Bob] |
---|
[718ad924] | 30 | #isMember(pBob, role(pGlobotron,admin), C). |
---|
| 31 | echo " " |
---|
[9502c50] | 32 | echo "===bad=============== Globotron.admin <- Bob" |
---|
[da5afdf] | 33 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 34 | --role "$glob_admin" --principal "$bob_prin" |
---|
[718ad924] | 35 | |
---|
[9502c50] | 36 | #[keyid:Acme].role:experiment_create <-?- [keyid:Bob] |
---|
[718ad924] | 37 | #isMember(pBob, role(pAcme,experiment_create), C). |
---|
| 38 | echo " " |
---|
[9502c50] | 39 | echo "===good=============== Acme.experiment_create <- Bob" |
---|
[da5afdf] | 40 | $eloc/abac_prover_yap --keystore $keyloc \ |
---|
| 41 | --role "$experiment_create" --principal "$bob_prin" |
---|
[718ad924] | 42 | |
---|
| 43 | |
---|