mei_rt2
Last change
on this file since b4b0d0a was
2e9455f,
checked in by Mei <mei@…>, 11 years ago
|
1) added namespace
2) tweak ?This,
3) allowing linking role/oset as constraining conditions
4) adding access_tests regression testing that uses GENI's access policy
5) added couple multi contexts regression tests
6) add compression/uncompression calls to abac_encode_string/abac_decode_string
(libstrongwan only allows 512 char for attribute rule storage)
7) add attribute_now option to creddy that takes a whole char string for attribute
rule
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | |
---|
3 | """ |
---|
4 | to test when an id gets loaded into the session |
---|
5 | vs when it gets loaded into a context |
---|
6 | |
---|
7 | cmd1:env keystore=`pwd` ./id_ctxt.py |
---|
8 | cmd2:env ABAC_CN=1 keystore=`pwd` ./id_ctxt.py |
---|
9 | |
---|
10 | """ |
---|
11 | |
---|
12 | import os |
---|
13 | import ABAC |
---|
14 | |
---|
15 | def pSZ(CTXT,msg): |
---|
16 | psz= CTXT.principal_count() |
---|
17 | csz= CTXT.credential_count() |
---|
18 | print "context [%s] %d principals, %d credentials" % (msg,psz,csz) |
---|
19 | |
---|
20 | ctxtA = ABAC.Context() |
---|
21 | ctxtB = ABAC.Context() |
---|
22 | |
---|
23 | ABAC.dump_debug_info("first") |
---|
24 | pSZ(ctxtA, "A") |
---|
25 | pSZ(ctxtB, "B") |
---|
26 | |
---|
27 | ## creating and writing out using libabac ID |
---|
28 | id=ABAC.ID("Ella", 0) |
---|
29 | print "adding -> %s(good) to session" % id.id_name() |
---|
30 | id.id_write_cert("Ella_ID.pem") |
---|
31 | id.id_write_privkey("Ella_private.pem") |
---|
32 | |
---|
33 | ABAC.dump_debug_info("second") |
---|
34 | pSZ(ctxtA, "A") |
---|
35 | pSZ(ctxtB, "B") |
---|
36 | |
---|
37 | ## load principal with id/key file pair |
---|
38 | ## note, with this, we do not have handle on the keyid |
---|
39 | ## to Ella but it will be in the db |
---|
40 | print "loading -> %s to ctxtA" % id.id_name() |
---|
41 | ctxtA.load_id_files("Ella_ID.pem","Ella_private.pem") |
---|
42 | |
---|
43 | print "loading -> Bob to ctxtB" |
---|
44 | ctxtB.load_id_files("Bob_ID.pem","Bob_private.pem") |
---|
45 | |
---|
46 | ABAC.dump_debug_info("third") |
---|
47 | pSZ(ctxtA, "A") |
---|
48 | pSZ(ctxtB, "B") |
---|
Note: See
TracBrowser
for help on using the repository browser.