Line | |
---|
1 | #!/usr/bin/env python |
---|
2 | """ |
---|
3 | attr3.py |
---|
4 | |
---|
5 | test different versions of attribute rule xml format |
---|
6 | |
---|
7 | """ |
---|
8 | import os |
---|
9 | import ABAC |
---|
10 | |
---|
11 | i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
---|
12 | a = ABAC.Attribute(i, "role", 3600) |
---|
13 | # Here's the format change |
---|
14 | a.set_output_format("GENIv1.0") |
---|
15 | # Format change above |
---|
16 | a.principal(i.keyid()); |
---|
17 | a.bake() |
---|
18 | a.write_file("V1_attr.xml") |
---|
19 | |
---|
20 | #### |
---|
21 | i2 = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
---|
22 | a2 = ABAC.Attribute(i, "role", 3600) |
---|
23 | # Here's the format change |
---|
24 | a2.set_output_format("GENIv1.1") |
---|
25 | # Format change above |
---|
26 | |
---|
27 | a2.principal(i2.keyid()); |
---|
28 | a2.bake() |
---|
29 | a2.write_file("V1_1_attr.xml") |
---|
30 | |
---|
31 | #### |
---|
32 | i3 = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
---|
33 | a3 = ABAC.Attribute(i, "role", 3600) |
---|
34 | a3.principal(i3.keyid()); |
---|
35 | a3.bake() |
---|
36 | a3.write_file("V1_1b_attr.xml") |
---|
37 | |
---|
38 | print a.get_output_format()+a2.get_output_format()+a3.get_output_format() |
---|
39 | |
---|
40 | |
---|
Note: See
TracBrowser
for help on using the repository browser.