source: examples/creddy_prover_tests/acme_rockets_rt0/run_query @ a0c1772

mei_rt2mei_rt2_fix_1
Last change on this file since a0c1772 was 5110d42, checked in by Mei <mei@…>, 13 years ago

1) reorganized the test directory to include python tests
2) attribute via api and principal via api from python scripts is

working (although there is a annoying seg fault at the very end
that must be related to something not been dup()ed.. need to wait
for c example to debug it)

3) able to query via api
4) replicated access_rt2 example in python and the query result matches
5) expanded api to make it easier to generate rt2 structure

  • Property mode set to 100755
File size: 1.5 KB
Line 
1
2# acme_rockets_rt0_typed
3
4pwd=`pwd`
5
6eloc=${ABAC_PROVER_PATH}
7keyloc=$pwd
8
9acme=`creddy --keyid --cert $keyloc/Acme_ID.pem`
10coyote=`creddy --keyid --cert $keyloc/Coyote_ID.pem`
11
12preferred_customer="[keyid:$acme].role:preferred_customer"
13buy_rockets="[keyid:$acme].role:buy_rockets"
14coyote_prin="[keyid:$coyote]"
15friend="[keyid:$acme].role:friend"
16acme_prin="[keyid:$acme]"
17
18## dump all credentials
19$eloc/abac_prover_yap  --keystore $keyloc --dump creds_dump
20
21#[keyid:Acme].role:preferred_customer <-?- [keyid:Coyote]
22#isMember(pCoyote, role(pAcme,preferred_customer), C).
23echo "  "
24echo "===good============ Acme.preferred_customer <- Coyote"
25$eloc/abac_prover_yap  --keystore $keyloc \
26      --role "$preferred_customer" --principal "$coyote_prin"
27
28#[keyid:Acme].role:buy_rockets <-?- [keyid:Coyote]
29#isMember(pCoyote, role(pAcme,buy_rockets), C).
30echo "  "
31echo "===good=============== Acme.buy_rockets <- Coyote"
32$eloc/abac_prover_yap  --keystore $keyloc \
33        --role "$buy_rockets" --principal "$coyote_prin"
34
35## this is not suppose to work
36#[keyid:Acme].role:buy_rockets <-?- [keyid:Acme].role:preferred_customer
37echo "  "
38echo "===bad=============== Acme.buy_rockets <- Acme.preferred_customer"
39$eloc/abac_prover_yap  --keystore $keyloc \
40        --role "$buy_rockets" --principal "$preferred_customer"
41
42#[keyid:Coyote].role:friend <-?- [keyid:Acme]
43#isMember(pAcme, role(pCoyote,friend), C).
44echo "  "
45echo "===bad=============== Coyote.friend <- Acme"
46$eloc/abac_prover_yap  --keystore $keyloc \
47        --role "$friend" --principal "$acme_prin"
48
Note: See TracBrowser for help on using the repository browser.