abac0-leak
Last change
on this file since 8a9f7af was
3c30b59,
checked in by Mei <mei@…>, 11 years ago
|
1) add in new refactored regression testing directory
2) undo the abac.hh/ABAC.hh api changes
3) merged with Ted's changes to attribute format/nickname/issuer processing
|
-
Property mode set to
100755
|
File size:
1.1 KB
|
Rev | Line | |
---|
[be6cb41] | 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 | cmd:env keystore=`pwd` ./id_ctxt.py |
---|
| 8 | |
---|
[3c30b59] | 9 | -- can not run in rt0 yet |
---|
[be6cb41] | 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.