abac0-leakabac0-mei
Last change
on this file since 84038c8 was
bceef20,
checked in by Mei <mei@…>, 11 years ago
|
1) add the new tests
|
-
Property mode set to
100755
|
File size:
714 bytes
|
Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | """ |
---|
3 | ctxtQuery4_setup.py |
---|
4 | |
---|
5 | creating a abac attribute credential |
---|
6 | acme.experiment_create <- acme |
---|
7 | |
---|
8 | """ |
---|
9 | import os |
---|
10 | import sys |
---|
11 | import ABAC |
---|
12 | |
---|
13 | ctx = ABAC.Context() |
---|
14 | |
---|
15 | ## note id did not get loaded into ctx and so keyid map is not generated |
---|
16 | ## hence no mnemonic table |
---|
17 | acme = ABAC.ID("Acme", 24 * 3600 * 365 * 20) |
---|
18 | attr = ABAC.Attribute(acme, "experiment_create", 24 * 3600 * 365 * 20) |
---|
19 | attr.principal(acme.keyid()) |
---|
20 | attr.bake(ctx) |
---|
21 | attr.write_file("abac_cred.xml") |
---|
22 | |
---|
23 | coyote = ABAC.ID("Coyote", 24 * 3600 * 365 * 20) |
---|
24 | ctx.load_id_chunk(coyote.cert_chunk()) |
---|
25 | attr2 = ABAC.Attribute(coyote, "lives_dangerously", 24 * 3600 * 365 * 20) |
---|
26 | attr2.principal(acme.keyid()) |
---|
27 | attr2.bake(ctx) |
---|
28 | attr2.write_file("coyote.xml") |
---|
Note: See
TracBrowser
for help on using the repository browser.