Ignore:
Timestamp:
Jan 15, 2011 5:52:15 PM (14 years ago)
Author:
Ted Faber <faber@…>
Branches:
axis_example, compt_changes, info-ops, master
Children:
aaf7f41
Parents:
ac15159 (diff), 944b746 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Ted Faber <faber@…> (01/15/11 17:51:40)
git-committer:
Ted Faber <faber@…> (01/15/11 17:52:15)
Message:

merge from current

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/access_to_abac.py

    rac15159 r0a49bd7  
    1212from federation.fedid import fedid
    1313from federation.authorizer import abac_authorizer
    14 from federation.util import abac_split_cert, abac_pem_type
     14from federation.util import abac_split_cert, abac_pem_type, file_expanding_opts
    1515
    1616
     
    185185
    186186
    187 def parse_access(fn, mapper):
     187def parse_access(fn, mapper, delegation_link):
    188188    """
    189189    Parse the access file, calling out to the mapper to parse specific
     
    224224
    225225
    226 class access_opts(OptionParser):
     226class access_opts(file_expanding_opts):
    227227    '''
    228228    Parse the options for this program.  Most are straightforward, but the
     
    247247
    248248    def __init__(self):
    249         OptionParser.__init__(self, usage='%prog [opts] file [...]')
     249        file_expanding_opts.__init__(self, usage='%prog [opts] file [...]')
    250250        self.add_option('--cert', dest='cert', default=None,
     251                type='str', action='callback', callback=self.expand_file,
    251252                help='my fedid as an X.509 certificate')
    252253        self.add_option('--key', dest='key', default=None,
     254                type='str', action='callback', callback=self.expand_file,
    253255                help='key for the certificate')
    254256        self.add_option('--dir', dest='dir', default=None,
     257                type='str', action='callback', callback=self.expand_file,
    255258                help='Output directory for credentials')
    256259        self.add_option('--type', action='callback', nargs=1, type='str',
     
    263266                default=False,
    264267                help='Do not print credential to local attribute map')
    265         self.add_option('--create-creds', action='store_true',
    266                 dest='create_creds', default=False,
    267                 help='create credentials for rules.  Requires ' + \
    268                         '--cert, --key, and --dir to be given.')
     268        self.add_option('--no_create_creds', action='store_false',
     269                dest='create_creds', default=True,
     270                help='Do not create credentials for rules.')
    269271        self.add_option('--file', dest='file', default=None,
     272                type='str', action='callback', callback=self.expand_file,
    270273                help='Access DB to parse.  If this is present, ' + \
    271274                        'omit the positional filename')
    272275        self.add_option('--mapfile', dest='map', default=None,
     276                type='str', action='callback', callback=self.expand_file,
    273277                help='File for the attribute to local authorization data')
    274278        self.add_option('--no-delegate', action='store_false', dest='delegate',
     
    276280                help='do not accept delegated attributes with the ' +\
    277281                        'acting_for linking role')
    278         self.add_option('--auth', action='store_true', dest='create_auth',
    279                 default=False, help='create a full ABAC authorizer')
     282        self.add_option('--no_auth', action='store_false', dest='create_auth',
     283                default=True, help='do not create a full ABAC authorizer')
    280284        self.add_option('--debug', action='store_true', dest='debug',
    281285                default=False, help='Just print actions')
     
    402406    for fn in args:
    403407        try:
    404             creds, to_id = parse_access(fn, opts.mapper)
     408            creds, to_id = parse_access(fn, opts.mapper, delegation_link)
    405409        except parse_error, e:
    406410            print >> sys.stderr, "%s" % e
Note: See TracChangeset for help on using the changeset viewer.