Changes between Initial Version and Version 1 of NewStuff


Ignore:
Timestamp:
Jun 17, 2013 3:31:24 PM (9 years ago)
Author:
faber
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • NewStuff

    v1 v1  
     1[TOC]
     2
     3= New Features In The Coming Release =
     4
     5This 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
     13This 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
     18Note 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
     20This code:
     21
     22{{{
     23#!/usr/local/bin/python
     24import sys
     25import ABAC
     26
     27
     28i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
     29a = ABAC.Attribute(i, "role", 3600)
     30
     31# Here's the format change
     32a.set_output_format("GENIv1.0")
     33# Format change above
     34
     35a.principal(i.keyid());
     36a.bake()
     37a.write(sys.stdout)
     38}}}
     39
     40Produces 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&lt;-ccae806d6e2ac13e39036d83ddc9d09a7f7bf23d</rt0>
     50    </credential>
     51    <signatures>
     52     <!-- elided -->
     53    </signatures>
     54  </credential>
     55</signed-credential>
     56}}}
     57
     58This code:
     59
     60{{{
     61
     62#!/usr/local/bin/python
     63import sys
     64import ABAC
     65
     66
     67i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
     68a = ABAC.Attribute(i, "role", 3600)
     69
     70# Here's the format change
     71a.set_output_format("GENIv1.1")
     72# Format change above
     73
     74a.principal(i.keyid());
     75a.bake()
     76a.write(sys.stdout)
     77
     78}}}
     79
     80Produces:
     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
     113Should you need to know the format in which an Attribute will be output:
     114
     115{{{
     116#!/usr/local/bin/python
     117import ABAC
     118
     119i = ABAC.ID("TestPrincipal", 10 * 356 * 24 * 3600)
     120a = ABAC.Attribute(i, "role", 3600)
     121print a.get_output_format()
     122}}}
     123