| 1 | [TOC] |
| 2 | |
| 3 | = New Features In The Coming Release = |
| 4 | |
| 5 | This pagdescribes features being developed for libabac and currently availabel on the {{{tvf-new-xml}}} branch of the git repository. There are three new features: |
| 6 | |
| 7 | * Support for multiple credential formats |
| 8 | * Support for Version 1.1 [http://http://groups.geni.net/geni/wiki/TIEDCredentials GENI credentials] |
| 9 | * Support for human readable strings in credential printing |
| 10 | |
| 11 | == New Credentials == |
| 12 | |
| 13 | This release supports multiple credential formats, specifically version 1 and version 1.1 [http://http://groups.geni.net/geni/wiki/TIEDCredentials GENI credentials] as well as reading GENI privilege credentials. Credentials read from files or chunks are transparenlty output as read, for example if they appear in a proof or if they are extracted from a context. Credentials that are created by an application are output in GENI v1.1 format by default, but can be created in GENI v1.0 using the set_output format of the Attribute object. Valid parameters to {{{set_output_format}}} are: |
| 14 | |
| 15 | * GENIv1.0 |
| 16 | * GENIv1.1 |
| 17 | |
| 18 | Note that the output format must be set before the attribute is {{{bake}}}d, and that the format cannot be changed after {{{bake}}} has been called. |
| 19 | |
| 20 | This code: |
| 21 | |
| 22 | {{{ |
| 23 | #!/usr/local/bin/python |
| 24 | import sys |
| 25 | import ABAC |
| 26 | |
| 27 | |
| 28 | i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
| 29 | a = ABAC.Attribute(i, "role", 3600) |
| 30 | |
| 31 | # Here's the format change |
| 32 | a.set_output_format("GENIv1.0") |
| 33 | # Format change above |
| 34 | |
| 35 | a.principal(i.keyid()); |
| 36 | a.bake() |
| 37 | a.write(sys.stdout) |
| 38 | }}} |
| 39 | |
| 40 | Produces output similar to: |
| 41 | |
| 42 | {{{ |
| 43 | <?xml version="1.0" encoding="UTF-8"?> |
| 44 | <signed-credential> |
| 45 | <credential xml:id="ref0"> |
| 46 | <type>abac</type> |
| 47 | <version>1.0</version> |
| 48 | <expires>2013-06-17T23:15:44Z</expires> |
| 49 | <rt0>ccae806d6e2ac13e39036d83ddc9d09a7f7bf23d.role<-ccae806d6e2ac13e39036d83ddc9d09a7f7bf23d</rt0> |
| 50 | </credential> |
| 51 | <signatures> |
| 52 | <!-- elided --> |
| 53 | </signatures> |
| 54 | </credential> |
| 55 | </signed-credential> |
| 56 | }}} |
| 57 | |
| 58 | This code: |
| 59 | |
| 60 | {{{ |
| 61 | |
| 62 | #!/usr/local/bin/python |
| 63 | import sys |
| 64 | import ABAC |
| 65 | |
| 66 | |
| 67 | i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
| 68 | a = ABAC.Attribute(i, "role", 3600) |
| 69 | |
| 70 | # Here's the format change |
| 71 | a.set_output_format("GENIv1.1") |
| 72 | # Format change above |
| 73 | |
| 74 | a.principal(i.keyid()); |
| 75 | a.bake() |
| 76 | a.write(sys.stdout) |
| 77 | |
| 78 | }}} |
| 79 | |
| 80 | Produces: |
| 81 | |
| 82 | {{{ |
| 83 | <?xml version="1.0" encoding="UTF-8"?> |
| 84 | <signed-credential> |
| 85 | <credential xml:id="ref0"> |
| 86 | <type>abac</type> |
| 87 | <serial/> |
| 88 | <owner_gid/> |
| 89 | <target_gid/> |
| 90 | <uuid/> |
| 91 | <expires>2013-06-17T23:17:58Z</expires> |
| 92 | <abac> |
| 93 | <rt0> |
| 94 | <version>1.1</version> |
| 95 | <head> |
| 96 | <ABACprincipal><keyid>394d50f1f95468521ea1042c88047d8db1bebadd</keyid></ABACprincipal> |
| 97 | <role>role</role> |
| 98 | </head> |
| 99 | <tail> |
| 100 | <ABACprincipal><keyid>394d50f1f95468521ea1042c88047d8db1bebadd</keyid></ABACprincipal> |
| 101 | </tail> |
| 102 | |
| 103 | </rt0> |
| 104 | </abac> |
| 105 | </credential> |
| 106 | <signatures> |
| 107 | <!-- elided --> |
| 108 | </signatures> |
| 109 | </credential> |
| 110 | </signed-credential> |
| 111 | }}} |
| 112 | |
| 113 | Should you need to know the format in which an Attribute will be output: |
| 114 | |
| 115 | {{{ |
| 116 | #!/usr/local/bin/python |
| 117 | import ABAC |
| 118 | |
| 119 | i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600) |
| 120 | a = ABAC.Attribute(i, "role", 3600) |
| 121 | print a.get_output_format() |
| 122 | }}} |
| 123 | |