abac0-leakabac0-mei
Last change
on this file since 081eabc was
65e3c6b,
checked in by Mei <mei@…>, 11 years ago
|
1) fixed an off by one bug in expand_key
|
-
Property mode set to
100755
|
File size:
935 bytes
|
Rev | Line | |
---|
[bceef20] | 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") |
---|
[65e3c6b] | 29 | |
---|
| 30 | bird = ABAC.ID("BigBird", 24 * 3600 * 365 * 20) |
---|
| 31 | ctx.load_id_chunk(bird.cert_chunk()) |
---|
| 32 | attr3 = ABAC.Attribute(bird, "nice", 24 * 3600 * 365 * 20) |
---|
| 33 | attr3.principal(acme.keyid()) |
---|
| 34 | attr3.bake(ctx) |
---|
| 35 | attr3.write_file("bird.xml") |
---|
| 36 | |
---|
Note: See
TracBrowser
for help on using the repository browser.