Ignore:
Timestamp:
Jan 11, 2012 4:02:07 PM (12 years ago)
Author:
Ted Faber <faber@…>
Branches:
compt_changes, info-ops, master
Children:
6886c5a
Parents:
ee950c2
Message:

DETER plugin can act as users now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • fedd/access_to_abac.py

    ree950c2 rf77a256  
    7171#  All the local parsing functions get the unparsed remainder of the line
    7272#  (after the three-name and the attribute it maps to), the credential list to
    73 #  add the new ABAC credential(s) that will be mapped into the loacl
     73#  add the new ABAC credential(s) that will be mapped into the local
    7474#  credentials, the fedid of this entity, a dict mapping the local credentials
    7575#  to ABAC credentials that are required to exercise those local rights and the
     
    7777def parse_emulab(l, creds, me, to_id, p, gp, gu, lr):
    7878    '''
    79     Parse the emulab (project, allocation_user, access_user) format.  Access
    80     users are deprecates and allocation users used for both.  This fuction
    81     collapses them.
    82     '''
    83     right_side_str = '\s*,\s*\(\s*%s\s*,\s*%s\s*,\s*%s\s*\)' % \
    84             (proj_same_str, id_same_str,id_same_str)
     79    Parse the emulab (project, allocation_user, cert_file) format.
     80    '''
     81    right_side_str = '\s*,\s*\(\s*%s\s*,\s*%s\s*,\s*(%s)\s*\)' % \
     82            (proj_same_str, id_same_str,path_str)
    8583
    8684    m = re.match(right_side_str, l)
    8785    if m:
    88         project, user = m.group(1,2)
     86        project, user, cert = m.group(1,2,3)
    8987        # Resolve "<same>"s in project and user
    9088        if project == '<same>':
     
    114112                [attribute(p, x, lr) for x in (gp, gu) if x is not None])
    115113        creds.add(c)
    116         if (project, user) in to_id: to_id[(project,user)].append(c)
    117         else: to_id[(project,user)] = [ c ]
     114        if (project, user,cert) in to_id: to_id[(project,user,cert)].append(c)
     115        else: to_id[(project,user,cert)] = [ c ]
    118116    else:
    119117        raise parse_error("Badly formatted local mapping: %s" % l)
     
    320318id_str = '[a-zA-Z][\w_-]*'
    321319proj_str = '[a-zA-Z][\w_/-]*'
    322 path_str = '[a-zA-Z_/\.-]+'
     320path_str = '[a-zA-Z0-9_/\.-]+'
    323321id_any_str = '(%s|<any>)' % id_str
    324322proj_any_str = '(%s|<any>)' % proj_str
Note: See TracChangeset for help on using the changeset viewer.